Ports: service -> application, defaults ->unconfigured

This commit is contained in:
Alex Ross
2021-03-16 13:35:19 +01:00
parent b33ce0ff5d
commit 9426cea171
3 changed files with 10 additions and 12 deletions
@@ -293,7 +293,7 @@ class OnAutoForwardedAction extends Disposable {
} }
private basicMessage(tunnel: RemoteTunnel) { private basicMessage(tunnel: RemoteTunnel) {
return nls.localize('remote.tunnelsView.automaticForward', "Your service running on port {0} is available. ", return nls.localize('remote.tunnelsView.automaticForward', "Your application running on port {0} is available. ",
tunnel.tunnelRemotePort); tunnel.tunnelRemotePort);
} }
@@ -175,21 +175,21 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
'label': { 'label': {
type: 'string', type: 'string',
description: localize('remote.portsAttributes.label', "Label that will be shown in the UI for this port."), description: localize('remote.portsAttributes.label', "Label that will be shown in the UI for this port."),
default: localize('remote.portsAttributes.labelDefault', "Labeled Port") default: localize('remote.portsAttributes.labelDefault', "Application")
} }
}, },
default: { default: {
'label': localize('remote.portsAttributes.labelDefault', "Labeled Port"), 'label': localize('remote.portsAttributes.labelDefault', "Application"),
'onAutoForward': 'notify' 'onAutoForward': 'notify'
} }
} }
}, },
markdownDescription: localize('remote.portsAttributes', "Set properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Labeled Port\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n},\n\".+\\\\/server.js\": {\n \"onAutoForward\": \"openPreview\"\n}\n```"), markdownDescription: localize('remote.portsAttributes', "Set properties that are applied when a specific port number is forwarded. For example:\n\n```\n\"3000\": {\n \"label\": \"Application\"\n},\n\"40000-55000\": {\n \"onAutoForward\": \"ignore\"\n},\n\".+\\\\/server.js\": {\n \"onAutoForward\": \"openPreview\"\n}\n```"),
defaultSnippets: [{ body: { '${1:3000}': { label: '${2:My Port}', onAutoForward: 'openPreview' } } }], defaultSnippets: [{ body: { '${1:3000}': { label: '${2:Application}', onAutoForward: 'openPreview' } } }],
errorMessage: localize('remote.portsAttributes.patternError', "Must be a port number, range of port numbers, or regular expression."), errorMessage: localize('remote.portsAttributes.patternError', "Must be a port number, range of port numbers, or regular expression."),
additionalProperties: false additionalProperties: false
}, },
'remote.portsAttributes.defaults': { 'remote.portsAttributes.unconfigured': {
type: 'object', type: 'object',
properties: { properties: {
'onAutoForward': { 'onAutoForward': {
@@ -213,13 +213,11 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
'label': { 'label': {
type: 'string', type: 'string',
description: localize('remote.portsAttributes.label', "Label that will be shown in the UI for this port."), description: localize('remote.portsAttributes.label', "Label that will be shown in the UI for this port."),
default: localize('remote.portsAttributes.labelDefault', "Labeled Port") default: localize('remote.portsAttributes.labelDefault', "Application")
} }
}, },
default: { defaultSnippets: [{ body: { onAutoForward: 'ignore' } }],
'onAutoForward': 'notify' markdownDescription: localize('remote.portsAttributes.defaults', "Set default properties that are applied to all ports that don't get properties from the setting `remote.portsAttributes`. For example:\n\n```\n{\n \"onAutoForward\": \"ignore\"\n}\n```"),
},
markdownDescription: localize('remote.portsAttributes.defaults', "Set default properties that are applied to all ports that don't get properties from the setting `remote.portsAttributes`. For example:\n\n```\n{\n \"onAutoForward\": \"notify\"\n}\n```"),
additionalProperties: false additionalProperties: false
} }
} }
@@ -154,7 +154,7 @@ interface PortAttributes extends Attributes {
export class PortsAttributes extends Disposable { export class PortsAttributes extends Disposable {
private static SETTING = 'remote.portsAttributes'; private static SETTING = 'remote.portsAttributes';
private static DEFAULTS = 'remote.portsAttributes.defaults'; private static DEFAULTS = 'remote.portsAttributes.unconfigured';
private static RANGE = /^(\d+)\-(\d+)$/; private static RANGE = /^(\d+)\-(\d+)$/;
private portsAttributes: PortAttributes[] = []; private portsAttributes: PortAttributes[] = [];
private defaultPortAttributes: Attributes | undefined; private defaultPortAttributes: Attributes | undefined;