mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 18:00:05 -05:00
tunnels: add preview dialog for turning on tunnel access
This commit is contained in:
@@ -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),
|
||||
}
|
||||
|
||||
@@ -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 };
|
||||
@@ -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, or on Github.'),
|
||||
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) {
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user