Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tunnels: add preview dialog for turning on tunnel access #167950

Merged
merged 2 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/src/commands/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ pub enum TunnelSubcommand {
#[clap(subcommand)]
User(TunnelUserSubCommands),

/// Manages the tunnel when installed as a system service,
/// (Preview) Manages the tunnel when installed as a system service,
#[clap(subcommand)]
Service(TunnelServiceSubCommands),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const REMOTE_TUNNEL_CONNECTION_STATE = new RawContextKey<CONTEXT_KEY_STAT
const SESSION_ID_STORAGE_KEY = 'remoteTunnelAccountPreference';

const REMOTE_TUNNEL_USED_STORAGE_KEY = 'remoteTunnelServiceUsed';
const REMOTE_TUNNEL_PROMPTED_PREVIEW_STORAGE_KEY = 'remoteTunnelServicePromptedPreview';
const REMOTE_TUNNEL_EXTENSION_RECOMMENDED_KEY = 'remoteTunnelExtensionRecommended';

type ExistingSessionItem = { session: AuthenticationSession; providerId: string; label: string; description: string };
Expand Down Expand Up @@ -487,6 +488,21 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
const clipboardService = accessor.get(IClipboardService);
const commandService = accessor.get(ICommandService);
const storageService = accessor.get(IStorageService);
const dialogService = accessor.get(IDialogService);

const didNotifyPreview = storageService.getBoolean(REMOTE_TUNNEL_PROMPTED_PREVIEW_STORAGE_KEY, StorageScope.APPLICATION, false);
if (!didNotifyPreview) {
const result = await dialogService.confirm({
message: localize('tunnel.preview', 'Remote Tunnels is currently in preview. Please report any problems using the "Help: Report Issue" command.'),
primaryButton: localize('ok', 'OK'),
secondaryButton: localize('cancel', 'Cancel'),
});
if (!result.confirmed) {
return;
}

storageService.store(REMOTE_TUNNEL_PROMPTED_PREVIEW_STORAGE_KEY, true, StorageScope.APPLICATION, StorageTarget.USER);
}

const connectionInfo = await that.startTunnel(false);
if (connectionInfo) {
Expand Down Expand Up @@ -548,7 +564,7 @@ export class RemoteTunnelWorkbenchContribution extends Disposable implements IWo
constructor() {
super({
id: RemoteTunnelCommandIds.connecting,
title: localize('remoteTunnel.actions.manage.connecting', 'Remote Tunnel Access in Connecting'),
title: localize('remoteTunnel.actions.manage.connecting', 'Remote Tunnel Access is Connecting'),
category: REMOTE_TUNNEL_CATEGORY,
menu: [{
id: MenuId.AccountsContext,
Expand Down