Skip to content

Commit 25cfb20

Browse files
committed
tunnels: add preview dialog for turning on tunnel access
1 parent 392aa77 commit 25cfb20

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

cli/src/commands/args.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ pub enum TunnelSubcommand {
595595
#[clap(subcommand)]
596596
User(TunnelUserSubCommands),
597597

598-
/// Manages the tunnel when installed as a system service,
598+
/// (Preview) Manages the tunnel when installed as a system service,
599599
#[clap(subcommand)]
600600
Service(TunnelServiceSubCommands),
601601
}

src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts

+17-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export const REMOTE_TUNNEL_CONNECTION_STATE = new RawContextKey<CONTEXT_KEY_STAT
5252
const SESSION_ID_STORAGE_KEY = 'remoteTunnelAccountPreference';
5353

5454
const REMOTE_TUNNEL_USED_STORAGE_KEY = 'remoteTunnelServiceUsed';
55+
const REMOTE_TUNNEL_PROMPTED_PREVIEW_STORAGE_KEY = 'remoteTunnelServicePromptedPreview';
5556
const REMOTE_TUNNEL_EXTENSION_RECOMMENDED_KEY = 'remoteTunnelExtensionRecommended';
5657

5758
type ExistingSessionItem = { session: AuthenticationSession; providerId: string; label: string; description: string };
@@ -487,6 +488,21 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
487488
const clipboardService = accessor.get(IClipboardService);
488489
const commandService = accessor.get(ICommandService);
489490
const storageService = accessor.get(IStorageService);
491+
const dialogService = accessor.get(IDialogService);
492+
493+
const didNotifyPreview = storageService.getBoolean(REMOTE_TUNNEL_PROMPTED_PREVIEW_STORAGE_KEY, StorageScope.APPLICATION, false);
494+
if (!didNotifyPreview) {
495+
const result = await dialogService.confirm({
496+
message: localize('tunnel.preview', 'Remote Tunnels is currently in preview. Please report any problems using the "Help: Report Issue" command, or on Github.'),
497+
primaryButton: localize('ok', 'OK'),
498+
secondaryButton: localize('cancel', 'Cancel'),
499+
});
500+
if (!result.confirmed) {
501+
return;
502+
}
503+
504+
storageService.store(REMOTE_TUNNEL_PROMPTED_PREVIEW_STORAGE_KEY, true, StorageScope.APPLICATION, StorageTarget.USER);
505+
}
490506

491507
const connectionInfo = await that.startTunnel(false);
492508
if (connectionInfo) {
@@ -548,7 +564,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
548564
constructor() {
549565
super({
550566
id: RemoteTunnelCommandIds.connecting,
551-
title: localize('remoteTunnel.actions.manage.connecting', 'Remote Tunnel Access in Connecting'),
567+
title: localize('remoteTunnel.actions.manage.connecting', 'Remote Tunnel Access is Connecting'),
552568
category: REMOTE_TUNNEL_CATEGORY,
553569
menu: [{
554570
id: MenuId.AccountsContext,

0 commit comments

Comments
 (0)