@codingame/monaco-vscode-views-service-override 1.83.1 → 1.83.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsPicker.js +44 -52
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +57 -57
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +1 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +229 -244
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +47 -47
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +75 -77
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.js +14 -14
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +41 -49
|
@@ -46,7 +46,7 @@ import { defaultButtonStyles, defaultInputBoxStyles } from 'monaco-editor/esm/vs
|
|
|
46
46
|
import { makeAddress, forwardedPortsViewEnabled, parseAddress, TunnelCloseReason, mapHasAddressLocalhostOrAllInterfaces } from 'vscode/vscode/vs/workbench/services/remote/common/tunnelModel';
|
|
47
47
|
|
|
48
48
|
var TunnelPanel_1;
|
|
49
|
-
const openPreviewEnabledContext = (
|
|
49
|
+
const openPreviewEnabledContext = ( new RawContextKey('openPreviewEnabled', false));
|
|
50
50
|
class TunnelTreeVirtualDelegate {
|
|
51
51
|
constructor(remoteExplorerService) {
|
|
52
52
|
this.remoteExplorerService = remoteExplorerService;
|
|
@@ -84,11 +84,11 @@ class IconColumn {
|
|
|
84
84
|
}
|
|
85
85
|
class PortColumn {
|
|
86
86
|
constructor() {
|
|
87
|
-
this.label = (
|
|
88
|
-
this.tooltip = (
|
|
87
|
+
this.label = ( nls.localize('tunnel.portColumn.label', "Port"));
|
|
88
|
+
this.tooltip = ( nls.localize(
|
|
89
89
|
'tunnel.portColumn.tooltip',
|
|
90
90
|
"The label and remote port number of the forwarded port."
|
|
91
|
-
))
|
|
91
|
+
));
|
|
92
92
|
this.weight = 1;
|
|
93
93
|
this.templateId = 'actionbar';
|
|
94
94
|
}
|
|
@@ -110,11 +110,11 @@ class PortColumn {
|
|
|
110
110
|
}
|
|
111
111
|
class LocalAddressColumn {
|
|
112
112
|
constructor() {
|
|
113
|
-
this.label = (
|
|
114
|
-
this.tooltip = (
|
|
113
|
+
this.label = ( nls.localize('tunnel.addressColumn.label', "Forwarded Address"));
|
|
114
|
+
this.tooltip = ( nls.localize(
|
|
115
115
|
'tunnel.addressColumn.tooltip',
|
|
116
116
|
"The address that the forwarded port is available at."
|
|
117
|
-
))
|
|
117
|
+
));
|
|
118
118
|
this.weight = 1;
|
|
119
119
|
this.templateId = 'actionbar';
|
|
120
120
|
}
|
|
@@ -142,21 +142,21 @@ class LocalAddressColumn {
|
|
|
142
142
|
let clickLabel = '';
|
|
143
143
|
if (editorConf.multiCursorModifier === 'ctrlCmd') {
|
|
144
144
|
if (isMacintosh) {
|
|
145
|
-
clickLabel = (
|
|
145
|
+
clickLabel = ( nls.localize('portsLink.followLinkAlt.mac', "option + click"));
|
|
146
146
|
}
|
|
147
147
|
else {
|
|
148
|
-
clickLabel = (
|
|
148
|
+
clickLabel = ( nls.localize('portsLink.followLinkAlt', "alt + click"));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
152
|
if (isMacintosh) {
|
|
153
|
-
clickLabel = (
|
|
153
|
+
clickLabel = ( nls.localize('portsLink.followLinkCmd', "cmd + click"));
|
|
154
154
|
}
|
|
155
155
|
else {
|
|
156
|
-
clickLabel = (
|
|
156
|
+
clickLabel = ( nls.localize('portsLink.followLinkCtrl', "ctrl + click"));
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
const markdown = (
|
|
159
|
+
const markdown = ( new MarkdownString('', true));
|
|
160
160
|
const uri = localAddress.startsWith('http') ? localAddress : `http://${localAddress}`;
|
|
161
161
|
return markdown.appendLink(uri, 'Follow link').appendMarkdown(` (${clickLabel})`);
|
|
162
162
|
};
|
|
@@ -164,11 +164,11 @@ class LocalAddressColumn {
|
|
|
164
164
|
}
|
|
165
165
|
class RunningProcessColumn {
|
|
166
166
|
constructor() {
|
|
167
|
-
this.label = (
|
|
168
|
-
this.tooltip = (
|
|
167
|
+
this.label = ( nls.localize('tunnel.processColumn.label', "Running Process"));
|
|
168
|
+
this.tooltip = ( nls.localize(
|
|
169
169
|
'tunnel.processColumn.tooltip',
|
|
170
170
|
"The command line of the process that is using the port."
|
|
171
|
-
))
|
|
171
|
+
));
|
|
172
172
|
this.weight = 2;
|
|
173
173
|
this.templateId = 'actionbar';
|
|
174
174
|
}
|
|
@@ -182,11 +182,11 @@ class RunningProcessColumn {
|
|
|
182
182
|
}
|
|
183
183
|
class OriginColumn {
|
|
184
184
|
constructor() {
|
|
185
|
-
this.label = (
|
|
186
|
-
this.tooltip = (
|
|
185
|
+
this.label = ( nls.localize('tunnel.originColumn.label', "Origin"));
|
|
186
|
+
this.tooltip = ( nls.localize(
|
|
187
187
|
'tunnel.originColumn.tooltip',
|
|
188
188
|
"The source that a forwarded port originates from. Can be an extension, user forwarded, statically forwarded, or automatically forwarded."
|
|
189
|
-
))
|
|
189
|
+
));
|
|
190
190
|
this.weight = 1;
|
|
191
191
|
this.templateId = 'actionbar';
|
|
192
192
|
}
|
|
@@ -201,8 +201,8 @@ class OriginColumn {
|
|
|
201
201
|
}
|
|
202
202
|
class PrivacyColumn {
|
|
203
203
|
constructor() {
|
|
204
|
-
this.label = (
|
|
205
|
-
this.tooltip = (
|
|
204
|
+
this.label = ( nls.localize('tunnel.privacyColumn.label', "Visibility"));
|
|
205
|
+
this.tooltip = ( nls.localize('tunnel.privacyColumn.tooltip', "The availability of the forwarded port."));
|
|
206
206
|
this.weight = 1;
|
|
207
207
|
this.templateId = 'actionbar';
|
|
208
208
|
}
|
|
@@ -237,17 +237,17 @@ let ActionBarRenderer = class ActionBarRenderer extends Disposable {
|
|
|
237
237
|
renderTemplate(container) {
|
|
238
238
|
const cell = dom.append(container, dom.$('.ports-view-actionbar-cell'));
|
|
239
239
|
const icon = dom.append(cell, dom.$('.ports-view-actionbar-cell-icon'));
|
|
240
|
-
const label = (
|
|
240
|
+
const label = ( new IconLabel(cell, {
|
|
241
241
|
supportHighlights: true,
|
|
242
242
|
hoverDelegate: {
|
|
243
243
|
showHover: (options) => this.hoverService.showHover(options),
|
|
244
244
|
delay: this.configurationService.getValue('workbench.hover.delay')
|
|
245
245
|
}
|
|
246
|
-
}))
|
|
246
|
+
}));
|
|
247
247
|
const actionsContainer = dom.append(cell, dom.$('.actions'));
|
|
248
|
-
const actionBar = (
|
|
248
|
+
const actionBar = ( new ActionBar(actionsContainer, {
|
|
249
249
|
actionViewItemProvider: createActionViewItem.bind(undefined, this.instantiationService)
|
|
250
|
-
}))
|
|
250
|
+
}));
|
|
251
251
|
return { label, icon, actionBar, container: cell, elementDisposable: Disposable.None };
|
|
252
252
|
}
|
|
253
253
|
renderElement(element, index, templateData) {
|
|
@@ -283,7 +283,7 @@ let ActionBarRenderer = class ActionBarRenderer extends Disposable {
|
|
|
283
283
|
renderButton(element, templateData) {
|
|
284
284
|
templateData.container.style.paddingLeft = '7px';
|
|
285
285
|
templateData.container.style.height = '28px';
|
|
286
|
-
templateData.button = this._register((
|
|
286
|
+
templateData.button = this._register(( new Button(templateData.container, defaultButtonStyles)));
|
|
287
287
|
templateData.button.label = element.label;
|
|
288
288
|
templateData.button.element.title = element.tooltip;
|
|
289
289
|
this._register(templateData.button.onDidClick(() => {
|
|
@@ -332,7 +332,7 @@ let ActionBarRenderer = class ActionBarRenderer extends Disposable {
|
|
|
332
332
|
[TunnelProtocolContextKey.key, element.tunnel.protocol]
|
|
333
333
|
];
|
|
334
334
|
const contextKeyService = this.contextKeyService.createOverlay(context);
|
|
335
|
-
const disposableStore = (
|
|
335
|
+
const disposableStore = ( new DisposableStore());
|
|
336
336
|
templateData.elementDisposable = disposableStore;
|
|
337
337
|
if (element.menuId) {
|
|
338
338
|
const menu = disposableStore.add(this.menuService.createMenu(element.menuId, contextKeyService));
|
|
@@ -364,8 +364,8 @@ let ActionBarRenderer = class ActionBarRenderer extends Disposable {
|
|
|
364
364
|
}
|
|
365
365
|
container.style.paddingLeft = '5px';
|
|
366
366
|
const value = editableData.startingValue || '';
|
|
367
|
-
const inputBox = (
|
|
368
|
-
ariaLabel: (
|
|
367
|
+
const inputBox = ( new InputBox(container, this.contextViewService, {
|
|
368
|
+
ariaLabel: ( nls.localize('remote.tunnelsView.input', "Press Enter to confirm or Escape to cancel.")),
|
|
369
369
|
validationOptions: {
|
|
370
370
|
validation: (value) => {
|
|
371
371
|
const message = editableData.validationMessage(value);
|
|
@@ -381,7 +381,7 @@ let ActionBarRenderer = class ActionBarRenderer extends Disposable {
|
|
|
381
381
|
},
|
|
382
382
|
placeholder: editableData.placeholder || '',
|
|
383
383
|
inputBoxStyles: defaultInputBoxStyles
|
|
384
|
-
}))
|
|
384
|
+
}));
|
|
385
385
|
inputBox.value = value;
|
|
386
386
|
inputBox.focus();
|
|
387
387
|
inputBox.select({ start: 0, end: editableData.startingValue ? editableData.startingValue.length : 0 });
|
|
@@ -433,58 +433,54 @@ let ActionBarRenderer = class ActionBarRenderer extends Disposable {
|
|
|
433
433
|
templateData.button?.dispose();
|
|
434
434
|
}
|
|
435
435
|
};
|
|
436
|
-
ActionBarRenderer = (
|
|
437
|
-
(
|
|
438
|
-
(
|
|
439
|
-
(
|
|
440
|
-
(
|
|
441
|
-
(
|
|
442
|
-
(
|
|
443
|
-
(
|
|
444
|
-
(
|
|
445
|
-
], ActionBarRenderer))
|
|
436
|
+
ActionBarRenderer = ( __decorate([
|
|
437
|
+
( __param(0, IInstantiationService)),
|
|
438
|
+
( __param(1, IContextKeyService)),
|
|
439
|
+
( __param(2, IMenuService)),
|
|
440
|
+
( __param(3, IContextViewService)),
|
|
441
|
+
( __param(4, IRemoteExplorerService)),
|
|
442
|
+
( __param(5, ICommandService)),
|
|
443
|
+
( __param(6, IConfigurationService)),
|
|
444
|
+
( __param(7, IHoverService))
|
|
445
|
+
], ActionBarRenderer));
|
|
446
446
|
class TunnelItem {
|
|
447
447
|
static createFromTunnel(remoteExplorerService, tunnelService, tunnel, type = TunnelType.Forwarded, closeable) {
|
|
448
|
-
return (
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
))
|
|
467
|
-
);
|
|
448
|
+
return ( new TunnelItem(
|
|
449
|
+
type,
|
|
450
|
+
tunnel.remoteHost,
|
|
451
|
+
tunnel.remotePort,
|
|
452
|
+
tunnel.source,
|
|
453
|
+
!!tunnel.hasRunningProcess,
|
|
454
|
+
tunnel.protocol,
|
|
455
|
+
tunnel.localUri,
|
|
456
|
+
tunnel.localAddress,
|
|
457
|
+
tunnel.localPort,
|
|
458
|
+
closeable === undefined ? tunnel.closeable : closeable,
|
|
459
|
+
tunnel.name,
|
|
460
|
+
tunnel.runningProcess,
|
|
461
|
+
tunnel.pid,
|
|
462
|
+
tunnel.privacy,
|
|
463
|
+
remoteExplorerService,
|
|
464
|
+
tunnelService
|
|
465
|
+
));
|
|
468
466
|
}
|
|
469
467
|
strip() {
|
|
470
|
-
return (
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
))
|
|
487
|
-
);
|
|
468
|
+
return ( new TunnelItem(
|
|
469
|
+
this.tunnelType,
|
|
470
|
+
this.remoteHost,
|
|
471
|
+
this.remotePort,
|
|
472
|
+
this.source,
|
|
473
|
+
this.hasRunningProcess,
|
|
474
|
+
this.protocol,
|
|
475
|
+
this.localUri,
|
|
476
|
+
this.localAddress,
|
|
477
|
+
this.localPort,
|
|
478
|
+
this.closeable,
|
|
479
|
+
this.name,
|
|
480
|
+
this.runningProcess,
|
|
481
|
+
this.pid,
|
|
482
|
+
this._privacy
|
|
483
|
+
));
|
|
488
484
|
}
|
|
489
485
|
constructor(tunnelType, remoteHost, remotePort, source, hasRunningProcess, protocol, localUri, localAddress, localPort, closeable, name, runningProcess, pid, _privacy, remoteExplorerService, tunnelService) {
|
|
490
486
|
this.tunnelType = tunnelType;
|
|
@@ -535,36 +531,36 @@ class TunnelItem {
|
|
|
535
531
|
}
|
|
536
532
|
}
|
|
537
533
|
else if (this.hasRunningProcess) {
|
|
538
|
-
description = (
|
|
534
|
+
description = ( nls.localize('tunnelView.runningProcess.inacessable', "Process information unavailable"));
|
|
539
535
|
}
|
|
540
536
|
return description;
|
|
541
537
|
}
|
|
542
538
|
get tooltipPostfix() {
|
|
543
539
|
let information;
|
|
544
540
|
if (this.localAddress) {
|
|
545
|
-
information = (
|
|
541
|
+
information = ( nls.localize(
|
|
546
542
|
'remote.tunnel.tooltipForwarded',
|
|
547
543
|
"Remote port {0}:{1} forwarded to local address {2}. ",
|
|
548
544
|
this.remoteHost,
|
|
549
545
|
this.remotePort,
|
|
550
546
|
this.localAddress
|
|
551
|
-
))
|
|
547
|
+
));
|
|
552
548
|
}
|
|
553
549
|
else {
|
|
554
|
-
information = (
|
|
550
|
+
information = ( nls.localize(
|
|
555
551
|
'remote.tunnel.tooltipCandidate',
|
|
556
552
|
"Remote port {0}:{1} not forwarded. ",
|
|
557
553
|
this.remoteHost,
|
|
558
554
|
this.remotePort
|
|
559
|
-
))
|
|
555
|
+
));
|
|
560
556
|
}
|
|
561
557
|
return information;
|
|
562
558
|
}
|
|
563
559
|
get iconTooltip() {
|
|
564
560
|
const isAdd = this.tunnelType === TunnelType.Add;
|
|
565
561
|
if (!isAdd) {
|
|
566
|
-
return `${this.processDescription ? (
|
|
567
|
-
(
|
|
562
|
+
return `${this.processDescription ? ( nls.localize('tunnel.iconColumn.running', "Port has running process.")) :
|
|
563
|
+
( nls.localize('tunnel.iconColumn.notRunning', "No running process."))}`;
|
|
568
564
|
}
|
|
569
565
|
else {
|
|
570
566
|
return this.label;
|
|
@@ -573,7 +569,7 @@ class TunnelItem {
|
|
|
573
569
|
get portTooltip() {
|
|
574
570
|
const isAdd = this.tunnelType === TunnelType.Add;
|
|
575
571
|
if (!isAdd) {
|
|
576
|
-
return `${this.name ? (
|
|
572
|
+
return `${this.name ? ( nls.localize('remote.tunnel.tooltipName', "Port labeled {0}. ", this.name)) : ''}`;
|
|
577
573
|
}
|
|
578
574
|
else {
|
|
579
575
|
return '';
|
|
@@ -591,37 +587,33 @@ class TunnelItem {
|
|
|
591
587
|
{
|
|
592
588
|
id: '',
|
|
593
589
|
themeIcon: Codicon.question.id,
|
|
594
|
-
label: (
|
|
590
|
+
label: ( nls.localize('tunnelPrivacy.unknown', "Unknown"))
|
|
595
591
|
};
|
|
596
592
|
}
|
|
597
593
|
else {
|
|
598
594
|
return {
|
|
599
595
|
id: TunnelPrivacyId.Private,
|
|
600
596
|
themeIcon: privatePortIcon.id,
|
|
601
|
-
label: (
|
|
597
|
+
label: ( nls.localize('tunnelPrivacy.private', "Private"))
|
|
602
598
|
};
|
|
603
599
|
}
|
|
604
600
|
}
|
|
605
601
|
}
|
|
606
|
-
const TunnelTypeContextKey = (
|
|
607
|
-
const TunnelCloseableContextKey = (
|
|
608
|
-
const TunnelPrivacyContextKey = (
|
|
609
|
-
const TunnelPrivacyEnabledContextKey = (
|
|
610
|
-
const TunnelProtocolContextKey = (
|
|
611
|
-
const TunnelViewFocusContextKey = (
|
|
612
|
-
'tunnelViewFocus',
|
|
613
|
-
false,
|
|
614
|
-
(nls.localize('tunnel.focusContext', "Whether the Ports view has focus."))
|
|
615
|
-
)));
|
|
602
|
+
const TunnelTypeContextKey = ( new RawContextKey('tunnelType', TunnelType.Add, true));
|
|
603
|
+
const TunnelCloseableContextKey = ( new RawContextKey('tunnelCloseable', false, true));
|
|
604
|
+
const TunnelPrivacyContextKey = ( new RawContextKey('tunnelPrivacy', undefined, true));
|
|
605
|
+
const TunnelPrivacyEnabledContextKey = ( new RawContextKey('tunnelPrivacyEnabled', false, true));
|
|
606
|
+
const TunnelProtocolContextKey = ( new RawContextKey('tunnelProtocol', TunnelProtocol.Http, true));
|
|
607
|
+
const TunnelViewFocusContextKey = ( new RawContextKey('tunnelViewFocus', false, ( nls.localize('tunnel.focusContext', "Whether the Ports view has focus."))));
|
|
616
608
|
const TunnelViewSelectionKeyName = 'tunnelViewSelection';
|
|
617
|
-
const TunnelViewSelectionContextKey = (
|
|
609
|
+
const TunnelViewSelectionContextKey = ( new RawContextKey(TunnelViewSelectionKeyName, undefined, true));
|
|
618
610
|
const TunnelViewMultiSelectionKeyName = 'tunnelViewMultiSelection';
|
|
619
|
-
const TunnelViewMultiSelectionContextKey = (
|
|
620
|
-
const PortChangableContextKey = (
|
|
611
|
+
const TunnelViewMultiSelectionContextKey = ( new RawContextKey(TunnelViewMultiSelectionKeyName, undefined, true));
|
|
612
|
+
const PortChangableContextKey = ( new RawContextKey('portChangable', false, true));
|
|
621
613
|
let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
622
614
|
static { TunnelPanel_1 = this; }
|
|
623
615
|
static { this.ID = TUNNEL_VIEW_ID; }
|
|
624
|
-
static { this.TITLE = (
|
|
616
|
+
static { this.TITLE = ( nls.localize('remote.tunnel', "Ports")); }
|
|
625
617
|
constructor(viewModel, options, keybindingService, contextMenuService, contextKeyService, configurationService, instantiationService, viewDescriptorService, openerService, quickInputService, commandService, menuService, themeService, remoteExplorerService, telemetryService, tunnelService, contextViewService, hoverService) {
|
|
626
618
|
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
627
619
|
this.viewModel = viewModel;
|
|
@@ -632,7 +624,7 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
632
624
|
this.tunnelService = tunnelService;
|
|
633
625
|
this.contextViewService = contextViewService;
|
|
634
626
|
this.hoverService = hoverService;
|
|
635
|
-
this.tableDisposables = this._register((
|
|
627
|
+
this.tableDisposables = this._register(( new DisposableStore()));
|
|
636
628
|
this.isEditing = false;
|
|
637
629
|
this.titleActions = [];
|
|
638
630
|
this.lastFocus = [];
|
|
@@ -680,7 +672,7 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
680
672
|
command: {
|
|
681
673
|
id: optionId,
|
|
682
674
|
title: privacyOption.label,
|
|
683
|
-
toggled: (
|
|
675
|
+
toggled: ( TunnelPrivacyContextKey.isEqualTo(privacyOption.id))
|
|
684
676
|
}
|
|
685
677
|
}));
|
|
686
678
|
}
|
|
@@ -697,7 +689,7 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
697
689
|
const widgetContainer = dom.append(this.panelContainer, dom.$('.customview-tree'));
|
|
698
690
|
widgetContainer.classList.add('ports-view');
|
|
699
691
|
widgetContainer.classList.add('file-icon-themable-tree', 'show-file-icons');
|
|
700
|
-
const actionBarRenderer = (
|
|
692
|
+
const actionBarRenderer = ( new ActionBarRenderer(
|
|
701
693
|
this.instantiationService,
|
|
702
694
|
this.contextKeyService,
|
|
703
695
|
this.menuService,
|
|
@@ -706,13 +698,13 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
706
698
|
this.commandService,
|
|
707
699
|
this.configurationService,
|
|
708
700
|
this.hoverService
|
|
709
|
-
))
|
|
710
|
-
const columns = [(
|
|
701
|
+
));
|
|
702
|
+
const columns = [( new IconColumn()), ( new PortColumn()), ( new LocalAddressColumn()), ( new RunningProcessColumn())];
|
|
711
703
|
if (this.tunnelService.canChangePrivacy) {
|
|
712
|
-
columns.push((
|
|
704
|
+
columns.push(( new PrivacyColumn()));
|
|
713
705
|
}
|
|
714
|
-
columns.push((
|
|
715
|
-
this.table = this.instantiationService.createInstance(WorkbenchTable, 'RemoteTunnels', widgetContainer, (
|
|
706
|
+
columns.push(( new OriginColumn()));
|
|
707
|
+
this.table = this.instantiationService.createInstance(WorkbenchTable, 'RemoteTunnels', widgetContainer, ( new TunnelTreeVirtualDelegate(this.remoteExplorerService)), columns, [actionBarRenderer], {
|
|
716
708
|
keyboardNavigationLabelProvider: {
|
|
717
709
|
getKeyboardNavigationLabel: (item) => {
|
|
718
710
|
return item.label;
|
|
@@ -728,11 +720,11 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
728
720
|
return item.label;
|
|
729
721
|
}
|
|
730
722
|
},
|
|
731
|
-
getWidgetAriaLabel: () => (
|
|
723
|
+
getWidgetAriaLabel: () => ( nls.localize('tunnelView', "Tunnel View"))
|
|
732
724
|
},
|
|
733
725
|
openOnSingleClick: true
|
|
734
726
|
});
|
|
735
|
-
const actionRunner = (
|
|
727
|
+
const actionRunner = ( new ActionRunner());
|
|
736
728
|
actionBarRenderer.actionRunner = actionRunner;
|
|
737
729
|
this.tableDisposables.add(this.table);
|
|
738
730
|
this.tableDisposables.add(this.table.onContextMenu(e => this.onContextMenu(e, actionRunner)));
|
|
@@ -844,7 +836,7 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
844
836
|
onSelectionChanged(event) {
|
|
845
837
|
const elements = event.elements;
|
|
846
838
|
if (elements.length > 1) {
|
|
847
|
-
this.tunnelViewMultiSelectionContext.set((
|
|
839
|
+
this.tunnelViewMultiSelectionContext.set(( elements.map(element => makeAddress(element.remoteHost, element.remotePort))));
|
|
848
840
|
}
|
|
849
841
|
else {
|
|
850
842
|
this.tunnelViewMultiSelectionContext.set(undefined);
|
|
@@ -880,9 +872,7 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
880
872
|
getActionViewItem: (action) => {
|
|
881
873
|
const keybinding = this.keybindingService.lookupKeybinding(action.id);
|
|
882
874
|
if (keybinding) {
|
|
883
|
-
return (
|
|
884
|
-
(new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel() }))
|
|
885
|
-
);
|
|
875
|
+
return ( new ActionViewItem(action, action, { label: true, keybinding: keybinding.getLabel() }));
|
|
886
876
|
}
|
|
887
877
|
return undefined;
|
|
888
878
|
},
|
|
@@ -907,31 +897,31 @@ let TunnelPanel = class TunnelPanel extends ViewPane {
|
|
|
907
897
|
this.table.layout(height, width);
|
|
908
898
|
}
|
|
909
899
|
};
|
|
910
|
-
TunnelPanel = TunnelPanel_1 = (
|
|
911
|
-
(
|
|
912
|
-
(
|
|
913
|
-
(
|
|
914
|
-
(
|
|
915
|
-
(
|
|
916
|
-
(
|
|
917
|
-
(
|
|
918
|
-
(
|
|
919
|
-
(
|
|
920
|
-
(
|
|
921
|
-
(
|
|
922
|
-
(
|
|
923
|
-
(
|
|
924
|
-
(
|
|
925
|
-
(
|
|
926
|
-
(
|
|
927
|
-
], TunnelPanel))
|
|
900
|
+
TunnelPanel = TunnelPanel_1 = ( __decorate([
|
|
901
|
+
( __param(2, IKeybindingService)),
|
|
902
|
+
( __param(3, IContextMenuService)),
|
|
903
|
+
( __param(4, IContextKeyService)),
|
|
904
|
+
( __param(5, IConfigurationService)),
|
|
905
|
+
( __param(6, IInstantiationService)),
|
|
906
|
+
( __param(7, IViewDescriptorService)),
|
|
907
|
+
( __param(8, IOpenerService)),
|
|
908
|
+
( __param(9, IQuickInputService)),
|
|
909
|
+
( __param(10, ICommandService)),
|
|
910
|
+
( __param(11, IMenuService)),
|
|
911
|
+
( __param(12, IThemeService)),
|
|
912
|
+
( __param(13, IRemoteExplorerService)),
|
|
913
|
+
( __param(14, ITelemetryService)),
|
|
914
|
+
( __param(15, ITunnelService)),
|
|
915
|
+
( __param(16, IContextViewService)),
|
|
916
|
+
( __param(17, IHoverService))
|
|
917
|
+
], TunnelPanel));
|
|
928
918
|
function isITunnelItem(item) {
|
|
929
919
|
return item && item.tunnelType && item.remoteHost && item.source;
|
|
930
920
|
}
|
|
931
921
|
var LabelTunnelAction;
|
|
932
|
-
( (
|
|
922
|
+
( (function(LabelTunnelAction) {
|
|
933
923
|
LabelTunnelAction.ID = 'remote.tunnel.label';
|
|
934
|
-
LabelTunnelAction.LABEL = (
|
|
924
|
+
LabelTunnelAction.LABEL = ( nls.localize('remote.tunnel.label', "Set Port Label"));
|
|
935
925
|
LabelTunnelAction.COMMAND_ID_KEYWORD = 'label';
|
|
936
926
|
function handler() {
|
|
937
927
|
return async (accessor, arg) => {
|
|
@@ -950,53 +940,51 @@ var LabelTunnelAction;
|
|
|
950
940
|
}
|
|
951
941
|
if (tunnelContext) {
|
|
952
942
|
const tunnelItem = tunnelContext;
|
|
953
|
-
return (
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
}))
|
|
971
|
-
);
|
|
943
|
+
return ( new Promise(resolve => {
|
|
944
|
+
const startingValue = tunnelItem.name ? tunnelItem.name : `${tunnelItem.remotePort}`;
|
|
945
|
+
remoteExplorerService.setEditable(tunnelItem, TunnelEditId.Label, {
|
|
946
|
+
onFinish: async (value, success) => {
|
|
947
|
+
value = value.trim();
|
|
948
|
+
remoteExplorerService.setEditable(tunnelItem, TunnelEditId.Label, null);
|
|
949
|
+
const changed = success && (value !== startingValue);
|
|
950
|
+
if (changed) {
|
|
951
|
+
await remoteExplorerService.tunnelModel.name(tunnelItem.remoteHost, tunnelItem.remotePort, value);
|
|
952
|
+
}
|
|
953
|
+
resolve(changed ? { port: tunnelItem.remotePort, label: value } : undefined);
|
|
954
|
+
},
|
|
955
|
+
validationMessage: () => null,
|
|
956
|
+
placeholder: ( nls.localize('remote.tunnelsView.labelPlaceholder', "Port label")),
|
|
957
|
+
startingValue
|
|
958
|
+
});
|
|
959
|
+
}));
|
|
972
960
|
}
|
|
973
961
|
return undefined;
|
|
974
962
|
};
|
|
975
963
|
}
|
|
976
964
|
LabelTunnelAction.handler = handler;
|
|
977
|
-
})(LabelTunnelAction || (LabelTunnelAction = {})))
|
|
978
|
-
const invalidPortString = (
|
|
965
|
+
})(LabelTunnelAction || (LabelTunnelAction = {})));
|
|
966
|
+
const invalidPortString = ( nls.localize(
|
|
979
967
|
'remote.tunnelsView.portNumberValid',
|
|
980
968
|
"Forwarded port should be a number or a host:port."
|
|
981
|
-
))
|
|
969
|
+
));
|
|
982
970
|
const maxPortNumber = 65536;
|
|
983
|
-
const invalidPortNumberString = (
|
|
971
|
+
const invalidPortNumberString = ( nls.localize(
|
|
984
972
|
'remote.tunnelsView.portNumberToHigh',
|
|
985
973
|
"Port number must be \u2265 0 and < {0}.",
|
|
986
974
|
maxPortNumber
|
|
987
|
-
))
|
|
988
|
-
const requiresSudoString = (
|
|
989
|
-
const alreadyForwarded = (
|
|
975
|
+
));
|
|
976
|
+
const requiresSudoString = ( nls.localize('remote.tunnelView.inlineElevationMessage', "May Require Sudo"));
|
|
977
|
+
const alreadyForwarded = ( nls.localize('remote.tunnelView.alreadyForwarded', "Port is already forwarded"));
|
|
990
978
|
var ForwardPortAction;
|
|
991
|
-
( (
|
|
979
|
+
( (function(ForwardPortAction) {
|
|
992
980
|
ForwardPortAction.INLINE_ID = 'remote.tunnel.forwardInline';
|
|
993
981
|
ForwardPortAction.COMMANDPALETTE_ID = 'remote.tunnel.forwardCommandPalette';
|
|
994
|
-
ForwardPortAction.LABEL = { value: (
|
|
995
|
-
ForwardPortAction.TREEITEM_LABEL = (
|
|
996
|
-
const forwardPrompt = (
|
|
982
|
+
ForwardPortAction.LABEL = { value: ( nls.localize('remote.tunnel.forward', "Forward a Port")), original: 'Forward a Port' };
|
|
983
|
+
ForwardPortAction.TREEITEM_LABEL = ( nls.localize('remote.tunnel.forwardItem', "Forward Port"));
|
|
984
|
+
const forwardPrompt = ( nls.localize(
|
|
997
985
|
'remote.tunnel.forwardPrompt',
|
|
998
986
|
"Port number or address (eg. 3000 or 10.10.10.10:2000)."
|
|
999
|
-
))
|
|
987
|
+
));
|
|
1000
988
|
function validateInput(remoteExplorerService, tunnelService, value, canElevate) {
|
|
1001
989
|
const parsed = parseAddress(value);
|
|
1002
990
|
if (!parsed) {
|
|
@@ -1015,21 +1003,21 @@ var ForwardPortAction;
|
|
|
1015
1003
|
}
|
|
1016
1004
|
function error(notificationService, tunnelOrError, host, port) {
|
|
1017
1005
|
if (!tunnelOrError) {
|
|
1018
|
-
notificationService.warn((
|
|
1006
|
+
notificationService.warn(( nls.localize(
|
|
1019
1007
|
'remote.tunnel.forwardError',
|
|
1020
1008
|
"Unable to forward {0}:{1}. The host may not be available or that remote port may already be forwarded",
|
|
1021
1009
|
host,
|
|
1022
1010
|
port
|
|
1023
|
-
)))
|
|
1011
|
+
)));
|
|
1024
1012
|
}
|
|
1025
1013
|
else if (typeof tunnelOrError === 'string') {
|
|
1026
|
-
notificationService.warn((
|
|
1014
|
+
notificationService.warn(( nls.localize(
|
|
1027
1015
|
'remote.tunnel.forwardErrorProvided',
|
|
1028
1016
|
"Unable to forward {0}:{1}. {2}",
|
|
1029
1017
|
host,
|
|
1030
1018
|
port,
|
|
1031
1019
|
tunnelOrError
|
|
1032
|
-
)))
|
|
1020
|
+
)));
|
|
1033
1021
|
}
|
|
1034
1022
|
}
|
|
1035
1023
|
function inlineHandler() {
|
|
@@ -1076,32 +1064,32 @@ var ForwardPortAction;
|
|
|
1076
1064
|
};
|
|
1077
1065
|
}
|
|
1078
1066
|
ForwardPortAction.commandPaletteHandler = commandPaletteHandler;
|
|
1079
|
-
})(ForwardPortAction || (ForwardPortAction = {})))
|
|
1067
|
+
})(ForwardPortAction || (ForwardPortAction = {})));
|
|
1080
1068
|
function makeTunnelPicks(tunnels, remoteExplorerService, tunnelService) {
|
|
1081
|
-
const picks = (
|
|
1069
|
+
const picks = ( tunnels.map(forwarded => {
|
|
1082
1070
|
const item = TunnelItem.createFromTunnel(remoteExplorerService, tunnelService, forwarded);
|
|
1083
1071
|
return {
|
|
1084
1072
|
label: item.label,
|
|
1085
1073
|
description: item.processDescription,
|
|
1086
1074
|
tunnel: item
|
|
1087
1075
|
};
|
|
1088
|
-
}))
|
|
1076
|
+
}));
|
|
1089
1077
|
if (picks.length === 0) {
|
|
1090
1078
|
picks.push({
|
|
1091
|
-
label: (
|
|
1079
|
+
label: ( nls.localize(
|
|
1092
1080
|
'remote.tunnel.closeNoPorts',
|
|
1093
1081
|
"No ports currently forwarded. Try running the {0} command",
|
|
1094
1082
|
ForwardPortAction.LABEL.value
|
|
1095
|
-
))
|
|
1083
|
+
))
|
|
1096
1084
|
});
|
|
1097
1085
|
}
|
|
1098
1086
|
return picks;
|
|
1099
1087
|
}
|
|
1100
1088
|
var ClosePortAction;
|
|
1101
|
-
( (
|
|
1089
|
+
( (function(ClosePortAction) {
|
|
1102
1090
|
ClosePortAction.INLINE_ID = 'remote.tunnel.closeInline';
|
|
1103
1091
|
ClosePortAction.COMMANDPALETTE_ID = 'remote.tunnel.closeCommandPalette';
|
|
1104
|
-
ClosePortAction.LABEL = { value: (
|
|
1092
|
+
ClosePortAction.LABEL = { value: ( nls.localize('remote.tunnel.close', "Stop Forwarding Port")), original: 'Stop Forwarding Port' };
|
|
1105
1093
|
function inlineHandler() {
|
|
1106
1094
|
return async (accessor, arg) => {
|
|
1107
1095
|
const contextKeyService = accessor.get(IContextKeyService);
|
|
@@ -1129,9 +1117,9 @@ var ClosePortAction;
|
|
|
1129
1117
|
if (!ports || ports.length === 0) {
|
|
1130
1118
|
return;
|
|
1131
1119
|
}
|
|
1132
|
-
return Promise.all((
|
|
1120
|
+
return Promise.all(( ports.map(
|
|
1133
1121
|
port => remoteExplorerService.close({ host: port.remoteHost, port: port.remotePort }, TunnelCloseReason.User)
|
|
1134
|
-
)))
|
|
1122
|
+
)));
|
|
1135
1123
|
};
|
|
1136
1124
|
}
|
|
1137
1125
|
ClosePortAction.inlineHandler = inlineHandler;
|
|
@@ -1141,8 +1129,8 @@ var ClosePortAction;
|
|
|
1141
1129
|
const remoteExplorerService = accessor.get(IRemoteExplorerService);
|
|
1142
1130
|
const tunnelService = accessor.get(ITunnelService);
|
|
1143
1131
|
const commandService = accessor.get(ICommandService);
|
|
1144
|
-
const picks = makeTunnelPicks(Array.from((
|
|
1145
|
-
const result = await quickInputService.pick(picks, { placeHolder: (
|
|
1132
|
+
const picks = makeTunnelPicks(Array.from(( remoteExplorerService.tunnelModel.forwarded.values())).filter(tunnel => tunnel.closeable), remoteExplorerService, tunnelService);
|
|
1133
|
+
const result = await quickInputService.pick(picks, { placeHolder: ( nls.localize('remote.tunnel.closePlaceholder', "Choose a port to stop forwarding")) });
|
|
1146
1134
|
if (result && result.tunnel) {
|
|
1147
1135
|
await remoteExplorerService.close({ host: result.tunnel.remoteHost, port: result.tunnel.remotePort }, TunnelCloseReason.User);
|
|
1148
1136
|
}
|
|
@@ -1152,11 +1140,11 @@ var ClosePortAction;
|
|
|
1152
1140
|
};
|
|
1153
1141
|
}
|
|
1154
1142
|
ClosePortAction.commandPaletteHandler = commandPaletteHandler;
|
|
1155
|
-
})(ClosePortAction || (ClosePortAction = {})))
|
|
1143
|
+
})(ClosePortAction || (ClosePortAction = {})));
|
|
1156
1144
|
var OpenPortInBrowserAction;
|
|
1157
|
-
( (
|
|
1145
|
+
( (function(OpenPortInBrowserAction) {
|
|
1158
1146
|
OpenPortInBrowserAction.ID = 'remote.tunnel.open';
|
|
1159
|
-
OpenPortInBrowserAction.LABEL = (
|
|
1147
|
+
OpenPortInBrowserAction.LABEL = ( nls.localize('remote.tunnel.open', "Open in Browser"));
|
|
1160
1148
|
function handler() {
|
|
1161
1149
|
return async (accessor, arg) => {
|
|
1162
1150
|
let key;
|
|
@@ -1182,11 +1170,11 @@ var OpenPortInBrowserAction;
|
|
|
1182
1170
|
return Promise.resolve();
|
|
1183
1171
|
}
|
|
1184
1172
|
OpenPortInBrowserAction.run = run;
|
|
1185
|
-
})(OpenPortInBrowserAction || (OpenPortInBrowserAction = {})))
|
|
1173
|
+
})(OpenPortInBrowserAction || (OpenPortInBrowserAction = {})));
|
|
1186
1174
|
var OpenPortInPreviewAction;
|
|
1187
|
-
( (
|
|
1175
|
+
( (function(OpenPortInPreviewAction) {
|
|
1188
1176
|
OpenPortInPreviewAction.ID = 'remote.tunnel.openPreview';
|
|
1189
|
-
OpenPortInPreviewAction.LABEL = (
|
|
1177
|
+
OpenPortInPreviewAction.LABEL = ( nls.localize('remote.tunnel.openPreview', "Preview in Editor"));
|
|
1190
1178
|
function handler() {
|
|
1191
1179
|
return async (accessor, arg) => {
|
|
1192
1180
|
let key;
|
|
@@ -1209,21 +1197,21 @@ var OpenPortInPreviewAction;
|
|
|
1209
1197
|
const tunnel = model.forwarded.get(key) || model.detected.get(key);
|
|
1210
1198
|
if (tunnel) {
|
|
1211
1199
|
const remoteHost = tunnel.remoteHost.includes(':') ? `[${tunnel.remoteHost}]` : tunnel.remoteHost;
|
|
1212
|
-
const sourceUri = (
|
|
1213
|
-
const opener = await externalOpenerService.getOpener(tunnel.localUri, { sourceUri }, (
|
|
1200
|
+
const sourceUri = ( URI.parse(`http://${remoteHost}:${tunnel.remotePort}`));
|
|
1201
|
+
const opener = await externalOpenerService.getOpener(tunnel.localUri, { sourceUri }, ( new CancellationTokenSource()).token);
|
|
1214
1202
|
if (opener) {
|
|
1215
|
-
return opener.openExternalUri(tunnel.localUri, { sourceUri }, (
|
|
1203
|
+
return opener.openExternalUri(tunnel.localUri, { sourceUri }, ( new CancellationTokenSource()).token);
|
|
1216
1204
|
}
|
|
1217
1205
|
return openerService.open(tunnel.localUri);
|
|
1218
1206
|
}
|
|
1219
1207
|
return Promise.resolve();
|
|
1220
1208
|
}
|
|
1221
1209
|
OpenPortInPreviewAction.run = run;
|
|
1222
|
-
})(OpenPortInPreviewAction || (OpenPortInPreviewAction = {})))
|
|
1210
|
+
})(OpenPortInPreviewAction || (OpenPortInPreviewAction = {})));
|
|
1223
1211
|
var OpenPortInBrowserCommandPaletteAction;
|
|
1224
|
-
( (
|
|
1212
|
+
( (function(OpenPortInBrowserCommandPaletteAction) {
|
|
1225
1213
|
OpenPortInBrowserCommandPaletteAction.ID = 'remote.tunnel.openCommandPalette';
|
|
1226
|
-
OpenPortInBrowserCommandPaletteAction.LABEL = (
|
|
1214
|
+
OpenPortInBrowserCommandPaletteAction.LABEL = ( nls.localize('remote.tunnel.openCommandPalette', "Open Port in Browser"));
|
|
1227
1215
|
function handler() {
|
|
1228
1216
|
return async (accessor, arg) => {
|
|
1229
1217
|
const remoteExplorerService = accessor.get(IRemoteExplorerService);
|
|
@@ -1232,28 +1220,28 @@ var OpenPortInBrowserCommandPaletteAction;
|
|
|
1232
1220
|
const quickPickService = accessor.get(IQuickInputService);
|
|
1233
1221
|
const openerService = accessor.get(IOpenerService);
|
|
1234
1222
|
const commandService = accessor.get(ICommandService);
|
|
1235
|
-
const options = (
|
|
1223
|
+
const options = ( [...model.forwarded, ...model.detected].map(value => {
|
|
1236
1224
|
const tunnelItem = TunnelItem.createFromTunnel(remoteExplorerService, tunnelService, value[1]);
|
|
1237
1225
|
return {
|
|
1238
1226
|
label: tunnelItem.label,
|
|
1239
1227
|
description: tunnelItem.processDescription,
|
|
1240
1228
|
tunnel: tunnelItem
|
|
1241
1229
|
};
|
|
1242
|
-
}))
|
|
1230
|
+
}));
|
|
1243
1231
|
if (options.length === 0) {
|
|
1244
1232
|
options.push({
|
|
1245
|
-
label: (
|
|
1233
|
+
label: ( nls.localize(
|
|
1246
1234
|
'remote.tunnel.openCommandPaletteNone',
|
|
1247
1235
|
"No ports currently forwarded. Open the Ports view to get started."
|
|
1248
|
-
))
|
|
1236
|
+
))
|
|
1249
1237
|
});
|
|
1250
1238
|
}
|
|
1251
1239
|
else {
|
|
1252
1240
|
options.push({
|
|
1253
|
-
label: (
|
|
1241
|
+
label: ( nls.localize('remote.tunnel.openCommandPaletteView', "Open the Ports view..."))
|
|
1254
1242
|
});
|
|
1255
1243
|
}
|
|
1256
|
-
const picked = await quickPickService.pick(options, { placeHolder: (
|
|
1244
|
+
const picked = await quickPickService.pick(options, { placeHolder: ( nls.localize('remote.tunnel.openCommandPalettePick', "Choose the port to open")) });
|
|
1257
1245
|
if (picked && picked.tunnel) {
|
|
1258
1246
|
return OpenPortInBrowserAction.run(model, openerService, makeAddress(picked.tunnel.remoteHost, picked.tunnel.remotePort));
|
|
1259
1247
|
}
|
|
@@ -1265,17 +1253,17 @@ var OpenPortInBrowserCommandPaletteAction;
|
|
|
1265
1253
|
OpenPortInBrowserCommandPaletteAction.handler = handler;
|
|
1266
1254
|
})(
|
|
1267
1255
|
OpenPortInBrowserCommandPaletteAction || (OpenPortInBrowserCommandPaletteAction = {})
|
|
1268
|
-
))
|
|
1256
|
+
));
|
|
1269
1257
|
var CopyAddressAction;
|
|
1270
|
-
( (
|
|
1258
|
+
( (function(CopyAddressAction) {
|
|
1271
1259
|
CopyAddressAction.INLINE_ID = 'remote.tunnel.copyAddressInline';
|
|
1272
1260
|
CopyAddressAction.COMMANDPALETTE_ID = 'remote.tunnel.copyAddressCommandPalette';
|
|
1273
|
-
CopyAddressAction.INLINE_LABEL = (
|
|
1274
|
-
CopyAddressAction.COMMANDPALETTE_LABEL = (
|
|
1261
|
+
CopyAddressAction.INLINE_LABEL = ( nls.localize('remote.tunnel.copyAddressInline', "Copy Local Address"));
|
|
1262
|
+
CopyAddressAction.COMMANDPALETTE_LABEL = ( nls.localize('remote.tunnel.copyAddressCommandPalette', "Copy Forwarded Port Address"));
|
|
1275
1263
|
async function copyAddress(remoteExplorerService, clipboardService, tunnelItem) {
|
|
1276
1264
|
const address = remoteExplorerService.tunnelModel.address(tunnelItem.remoteHost, tunnelItem.remotePort);
|
|
1277
1265
|
if (address) {
|
|
1278
|
-
await clipboardService.writeText((
|
|
1266
|
+
await clipboardService.writeText(( address.toString()));
|
|
1279
1267
|
}
|
|
1280
1268
|
}
|
|
1281
1269
|
function inlineHandler() {
|
|
@@ -1302,8 +1290,8 @@ var CopyAddressAction;
|
|
|
1302
1290
|
const tunnelService = accessor.get(ITunnelService);
|
|
1303
1291
|
const commandService = accessor.get(ICommandService);
|
|
1304
1292
|
const clipboardService = accessor.get(IClipboardService);
|
|
1305
|
-
const tunnels = Array.from((
|
|
1306
|
-
const result = await quickInputService.pick(makeTunnelPicks(tunnels, remoteExplorerService, tunnelService), { placeHolder: (
|
|
1293
|
+
const tunnels = Array.from(( remoteExplorerService.tunnelModel.forwarded.values())).concat(Array.from(( remoteExplorerService.tunnelModel.detected.values())));
|
|
1294
|
+
const result = await quickInputService.pick(makeTunnelPicks(tunnels, remoteExplorerService, tunnelService), { placeHolder: ( nls.localize('remote.tunnel.copyAddressPlaceholdter', "Choose a forwarded port")) });
|
|
1307
1295
|
if (result && result.tunnel) {
|
|
1308
1296
|
await copyAddress(remoteExplorerService, clipboardService, result.tunnel);
|
|
1309
1297
|
}
|
|
@@ -1313,14 +1301,14 @@ var CopyAddressAction;
|
|
|
1313
1301
|
};
|
|
1314
1302
|
}
|
|
1315
1303
|
CopyAddressAction.commandPaletteHandler = commandPaletteHandler;
|
|
1316
|
-
})(CopyAddressAction || (CopyAddressAction = {})))
|
|
1304
|
+
})(CopyAddressAction || (CopyAddressAction = {})));
|
|
1317
1305
|
var ChangeLocalPortAction;
|
|
1318
|
-
( (
|
|
1306
|
+
( (function(ChangeLocalPortAction) {
|
|
1319
1307
|
ChangeLocalPortAction.ID = 'remote.tunnel.changeLocalPort';
|
|
1320
|
-
ChangeLocalPortAction.LABEL = (
|
|
1308
|
+
ChangeLocalPortAction.LABEL = ( nls.localize('remote.tunnel.changeLocalPort', "Change Local Address Port"));
|
|
1321
1309
|
function validateInput(tunnelService, value, canElevate) {
|
|
1322
1310
|
if (!value.match(/^[0-9]+$/)) {
|
|
1323
|
-
return { content: (
|
|
1311
|
+
return { content: ( nls.localize('remote.tunnelsView.portShouldBeNumber', "Local port should be a number.")), severity: Severity.Error };
|
|
1324
1312
|
}
|
|
1325
1313
|
else if (Number(value) >= maxPortNumber) {
|
|
1326
1314
|
return { content: invalidPortNumberString, severity: Severity.Error };
|
|
@@ -1363,25 +1351,25 @@ var ChangeLocalPortAction;
|
|
|
1363
1351
|
source: tunnelItem.source
|
|
1364
1352
|
});
|
|
1365
1353
|
if (newForward && (typeof newForward !== 'string') && newForward.tunnelLocalPort !== numberValue) {
|
|
1366
|
-
notificationService.warn((
|
|
1354
|
+
notificationService.warn(( nls.localize(
|
|
1367
1355
|
'remote.tunnel.changeLocalPortNumber',
|
|
1368
1356
|
"The local port {0} is not available. Port number {1} has been used instead",
|
|
1369
1357
|
value,
|
|
1370
1358
|
newForward.tunnelLocalPort ?? newForward.localAddress
|
|
1371
|
-
)))
|
|
1359
|
+
)));
|
|
1372
1360
|
}
|
|
1373
1361
|
}
|
|
1374
1362
|
},
|
|
1375
1363
|
validationMessage: (value) => validateInput(tunnelService, value, tunnelService.canElevate),
|
|
1376
|
-
placeholder: (
|
|
1364
|
+
placeholder: ( nls.localize('remote.tunnelsView.changePort', "New local port"))
|
|
1377
1365
|
});
|
|
1378
1366
|
}
|
|
1379
1367
|
};
|
|
1380
1368
|
}
|
|
1381
1369
|
ChangeLocalPortAction.handler = handler;
|
|
1382
|
-
})(ChangeLocalPortAction || (ChangeLocalPortAction = {})))
|
|
1370
|
+
})(ChangeLocalPortAction || (ChangeLocalPortAction = {})));
|
|
1383
1371
|
var ChangeTunnelPrivacyAction;
|
|
1384
|
-
( (
|
|
1372
|
+
( (function(ChangeTunnelPrivacyAction) {
|
|
1385
1373
|
function handler(privacyId) {
|
|
1386
1374
|
return async (accessor, arg) => {
|
|
1387
1375
|
if (isITunnelItem(arg)) {
|
|
@@ -1400,13 +1388,13 @@ var ChangeTunnelPrivacyAction;
|
|
|
1400
1388
|
};
|
|
1401
1389
|
}
|
|
1402
1390
|
ChangeTunnelPrivacyAction.handler = handler;
|
|
1403
|
-
})(ChangeTunnelPrivacyAction || (ChangeTunnelPrivacyAction = {})))
|
|
1391
|
+
})(ChangeTunnelPrivacyAction || (ChangeTunnelPrivacyAction = {})));
|
|
1404
1392
|
var SetTunnelProtocolAction;
|
|
1405
|
-
( (
|
|
1393
|
+
( (function(SetTunnelProtocolAction) {
|
|
1406
1394
|
SetTunnelProtocolAction.ID_HTTP = 'remote.tunnel.setProtocolHttp';
|
|
1407
1395
|
SetTunnelProtocolAction.ID_HTTPS = 'remote.tunnel.setProtocolHttps';
|
|
1408
|
-
SetTunnelProtocolAction.LABEL_HTTP = (
|
|
1409
|
-
SetTunnelProtocolAction.LABEL_HTTPS = (
|
|
1396
|
+
SetTunnelProtocolAction.LABEL_HTTP = ( nls.localize('remote.tunnel.protocolHttp', "HTTP"));
|
|
1397
|
+
SetTunnelProtocolAction.LABEL_HTTPS = ( nls.localize('remote.tunnel.protocolHttps', "HTTPS"));
|
|
1410
1398
|
async function handler(arg, protocol, remoteExplorerService) {
|
|
1411
1399
|
if (isITunnelItem(arg)) {
|
|
1412
1400
|
const attributes = {
|
|
@@ -1427,18 +1415,15 @@ var SetTunnelProtocolAction;
|
|
|
1427
1415
|
};
|
|
1428
1416
|
}
|
|
1429
1417
|
SetTunnelProtocolAction.handlerHttps = handlerHttps;
|
|
1430
|
-
})(SetTunnelProtocolAction || (SetTunnelProtocolAction = {})))
|
|
1418
|
+
})(SetTunnelProtocolAction || (SetTunnelProtocolAction = {})));
|
|
1431
1419
|
const tunnelViewCommandsWeightBonus = 10;
|
|
1432
|
-
const isForwardedExpr = (
|
|
1433
|
-
const isForwardedOrDetectedExpr = (
|
|
1434
|
-
|
|
1435
|
-
(TunnelTypeContextKey.isEqualTo(TunnelType.Detected))
|
|
1436
|
-
)));
|
|
1437
|
-
const isNotMultiSelectionExpr = ( (TunnelViewMultiSelectionContextKey.isEqualTo(undefined)));
|
|
1420
|
+
const isForwardedExpr = ( TunnelTypeContextKey.isEqualTo(TunnelType.Forwarded));
|
|
1421
|
+
const isForwardedOrDetectedExpr = ( ContextKeyExpr.or(isForwardedExpr, ( TunnelTypeContextKey.isEqualTo(TunnelType.Detected))));
|
|
1422
|
+
const isNotMultiSelectionExpr = ( TunnelViewMultiSelectionContextKey.isEqualTo(undefined));
|
|
1438
1423
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
1439
1424
|
id: LabelTunnelAction.ID,
|
|
1440
1425
|
weight: 200 + tunnelViewCommandsWeightBonus,
|
|
1441
|
-
when: (
|
|
1426
|
+
when: ( ContextKeyExpr.and(TunnelViewFocusContextKey, isForwardedExpr, isNotMultiSelectionExpr)),
|
|
1442
1427
|
primary: 60 ,
|
|
1443
1428
|
mac: {
|
|
1444
1429
|
primary: 3
|
|
@@ -1450,7 +1435,7 @@ CommandsRegistry.registerCommand(ForwardPortAction.COMMANDPALETTE_ID, ForwardPor
|
|
|
1450
1435
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
1451
1436
|
id: ClosePortAction.INLINE_ID,
|
|
1452
1437
|
weight: 200 + tunnelViewCommandsWeightBonus,
|
|
1453
|
-
when: (
|
|
1438
|
+
when: ( ContextKeyExpr.and(TunnelCloseableContextKey, TunnelViewFocusContextKey)),
|
|
1454
1439
|
primary: 20 ,
|
|
1455
1440
|
mac: {
|
|
1456
1441
|
primary: 2048 | 1 ,
|
|
@@ -1465,11 +1450,11 @@ CommandsRegistry.registerCommand(OpenPortInBrowserCommandPaletteAction.ID, OpenP
|
|
|
1465
1450
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
1466
1451
|
id: CopyAddressAction.INLINE_ID,
|
|
1467
1452
|
weight: 200 + tunnelViewCommandsWeightBonus,
|
|
1468
|
-
when: (
|
|
1453
|
+
when: ( ContextKeyExpr.and(
|
|
1469
1454
|
TunnelViewFocusContextKey,
|
|
1470
1455
|
isForwardedOrDetectedExpr,
|
|
1471
1456
|
isNotMultiSelectionExpr
|
|
1472
|
-
))
|
|
1457
|
+
)),
|
|
1473
1458
|
primary: 2048 | 33 ,
|
|
1474
1459
|
handler: CopyAddressAction.inlineHandler()
|
|
1475
1460
|
});
|
|
@@ -1512,7 +1497,7 @@ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
|
1512
1497
|
id: OpenPortInBrowserAction.ID,
|
|
1513
1498
|
title: OpenPortInBrowserAction.LABEL,
|
|
1514
1499
|
},
|
|
1515
|
-
when: (
|
|
1500
|
+
when: ( ContextKeyExpr.and(isForwardedOrDetectedExpr, isNotMultiSelectionExpr))
|
|
1516
1501
|
}));
|
|
1517
1502
|
MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
1518
1503
|
group: '._open',
|
|
@@ -1521,7 +1506,7 @@ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
|
1521
1506
|
id: OpenPortInPreviewAction.ID,
|
|
1522
1507
|
title: OpenPortInPreviewAction.LABEL,
|
|
1523
1508
|
},
|
|
1524
|
-
when: (
|
|
1509
|
+
when: ( ContextKeyExpr.and(isForwardedOrDetectedExpr, isNotMultiSelectionExpr))
|
|
1525
1510
|
}));
|
|
1526
1511
|
MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
1527
1512
|
group: '0_manage',
|
|
@@ -1531,7 +1516,7 @@ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
|
1531
1516
|
title: LabelTunnelAction.LABEL,
|
|
1532
1517
|
icon: labelPortIcon
|
|
1533
1518
|
},
|
|
1534
|
-
when: (
|
|
1519
|
+
when: ( ContextKeyExpr.and(isForwardedExpr, isNotMultiSelectionExpr))
|
|
1535
1520
|
}));
|
|
1536
1521
|
MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
1537
1522
|
group: '2_localaddress',
|
|
@@ -1540,7 +1525,7 @@ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
|
1540
1525
|
id: CopyAddressAction.INLINE_ID,
|
|
1541
1526
|
title: CopyAddressAction.INLINE_LABEL,
|
|
1542
1527
|
},
|
|
1543
|
-
when: (
|
|
1528
|
+
when: ( ContextKeyExpr.and(isForwardedOrDetectedExpr, isNotMultiSelectionExpr))
|
|
1544
1529
|
}));
|
|
1545
1530
|
MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
1546
1531
|
group: '2_localaddress',
|
|
@@ -1549,21 +1534,21 @@ MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
|
1549
1534
|
id: ChangeLocalPortAction.ID,
|
|
1550
1535
|
title: ChangeLocalPortAction.LABEL,
|
|
1551
1536
|
},
|
|
1552
|
-
when: (
|
|
1537
|
+
when: ( ContextKeyExpr.and(isForwardedExpr, PortChangableContextKey, isNotMultiSelectionExpr))
|
|
1553
1538
|
}));
|
|
1554
1539
|
MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
1555
1540
|
group: '2_localaddress',
|
|
1556
1541
|
order: 2,
|
|
1557
1542
|
submenu: MenuId.TunnelPrivacy,
|
|
1558
|
-
title: (
|
|
1559
|
-
when: (
|
|
1543
|
+
title: ( nls.localize('tunnelContext.privacyMenu', "Port Visibility")),
|
|
1544
|
+
when: ( ContextKeyExpr.and(isForwardedExpr, TunnelPrivacyEnabledContextKey))
|
|
1560
1545
|
}));
|
|
1561
1546
|
MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
1562
1547
|
group: '2_localaddress',
|
|
1563
1548
|
order: 3,
|
|
1564
1549
|
submenu: MenuId.TunnelProtocol,
|
|
1565
|
-
title: (
|
|
1566
|
-
when: (
|
|
1550
|
+
title: ( nls.localize('tunnelContext.protocolMenu', "Change Port Protocol")),
|
|
1551
|
+
when: ( ContextKeyExpr.and(isForwardedExpr, isNotMultiSelectionExpr))
|
|
1567
1552
|
}));
|
|
1568
1553
|
MenuRegistry.appendMenuItem(MenuId.TunnelContext, ({
|
|
1569
1554
|
group: '3_forward',
|
|
@@ -1587,7 +1572,7 @@ MenuRegistry.appendMenuItem(MenuId.TunnelProtocol, ({
|
|
|
1587
1572
|
command: {
|
|
1588
1573
|
id: SetTunnelProtocolAction.ID_HTTP,
|
|
1589
1574
|
title: SetTunnelProtocolAction.LABEL_HTTP,
|
|
1590
|
-
toggled: (
|
|
1575
|
+
toggled: ( TunnelProtocolContextKey.isEqualTo(TunnelProtocol.Http))
|
|
1591
1576
|
}
|
|
1592
1577
|
}));
|
|
1593
1578
|
MenuRegistry.appendMenuItem(MenuId.TunnelProtocol, ({
|
|
@@ -1595,7 +1580,7 @@ MenuRegistry.appendMenuItem(MenuId.TunnelProtocol, ({
|
|
|
1595
1580
|
command: {
|
|
1596
1581
|
id: SetTunnelProtocolAction.ID_HTTPS,
|
|
1597
1582
|
title: SetTunnelProtocolAction.LABEL_HTTPS,
|
|
1598
|
-
toggled: (
|
|
1583
|
+
toggled: ( TunnelProtocolContextKey.isEqualTo(TunnelProtocol.Https))
|
|
1599
1584
|
}
|
|
1600
1585
|
}));
|
|
1601
1586
|
MenuRegistry.appendMenuItem(MenuId.TunnelPortInline, ({
|
|
@@ -1606,7 +1591,7 @@ MenuRegistry.appendMenuItem(MenuId.TunnelPortInline, ({
|
|
|
1606
1591
|
title: ForwardPortAction.TREEITEM_LABEL,
|
|
1607
1592
|
icon: forwardPortIcon
|
|
1608
1593
|
},
|
|
1609
|
-
when: (
|
|
1594
|
+
when: ( TunnelTypeContextKey.isEqualTo(TunnelType.Candidate))
|
|
1610
1595
|
}));
|
|
1611
1596
|
MenuRegistry.appendMenuItem(MenuId.TunnelPortInline, ({
|
|
1612
1597
|
group: '0_manage',
|
|
@@ -1660,9 +1645,9 @@ registerColor('ports.iconRunningProcessForeground', {
|
|
|
1660
1645
|
dark: STATUS_BAR_REMOTE_ITEM_BACKGROUND,
|
|
1661
1646
|
hcDark: STATUS_BAR_REMOTE_ITEM_BACKGROUND,
|
|
1662
1647
|
hcLight: STATUS_BAR_REMOTE_ITEM_BACKGROUND
|
|
1663
|
-
}, (
|
|
1648
|
+
}, ( nls.localize(
|
|
1664
1649
|
'portWithRunningProcess.foreground',
|
|
1665
1650
|
"The color of the icon for a port that has an associated running process."
|
|
1666
|
-
)))
|
|
1651
|
+
)));
|
|
1667
1652
|
|
|
1668
1653
|
export { ForwardPortAction, OpenPortInBrowserAction, OpenPortInPreviewAction, TunnelPanel, openPreviewEnabledContext };
|