@@ -21,7 +21,7 @@ import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal
21
21
import { IDebugService } from 'vs/workbench/contrib/debug/common/debug' ;
22
22
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
23
23
import { isWeb , OperatingSystem } from 'vs/base/common/platform' ;
24
- import { ITunnelService , RemoteTunnel } from 'vs/platform/tunnel/common/tunnel' ;
24
+ import { ITunnelService , RemoteTunnel , TunnelPrivacyId } from 'vs/platform/tunnel/common/tunnel' ;
25
25
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' ;
26
26
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer' ;
27
27
import { IActivityService , NumberBadge } from 'vs/workbench/services/activity/common/activity' ;
@@ -348,6 +348,10 @@ class OnAutoForwardedAction extends Disposable {
348
348
choices . unshift ( this . elevateChoice ( tunnel ) ) ;
349
349
}
350
350
351
+ if ( tunnel . privacy === TunnelPrivacyId . Private && isWeb && this . tunnelService . canChangePrivacy ) {
352
+ choices . push ( this . makePublicChoice ( tunnel ) ) ;
353
+ }
354
+
351
355
message += this . linkMessage ( ) ;
352
356
353
357
this . lastNotification = this . notificationService . prompt ( Severity . Info , message , choices , { neverShowAgain : { id : 'remote.tunnelsView.autoForwardNeverShow' , isSecondary : true } } ) ;
@@ -359,6 +363,20 @@ class OnAutoForwardedAction extends Disposable {
359
363
} ) ;
360
364
}
361
365
366
+ private makePublicChoice ( tunnel : RemoteTunnel ) : IPromptChoice {
367
+ return {
368
+ label : nls . localize ( 'remote.tunnelsView.makePublic' , "Make Public" ) ,
369
+ run : async ( ) => {
370
+ await this . remoteExplorerService . close ( { host : tunnel . tunnelRemoteHost , port : tunnel . tunnelRemotePort } , TunnelCloseReason . Other ) ;
371
+ return this . remoteExplorerService . forward ( {
372
+ remote : { host : tunnel . tunnelRemoteHost , port : tunnel . tunnelRemotePort } ,
373
+ local : tunnel . tunnelLocalPort ,
374
+ privacy : TunnelPrivacyId . Public ,
375
+ } ) ;
376
+ }
377
+ } ;
378
+ }
379
+
362
380
private openBrowserChoice ( tunnel : RemoteTunnel ) : IPromptChoice {
363
381
const address = makeAddress ( tunnel . tunnelRemoteHost , tunnel . tunnelRemotePort ) ;
364
382
return {
0 commit comments