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

Show the devcontainer label value specified in portsAttributes within the port notification instead of "your application" #200667

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,11 @@ class OnAutoForwardedAction extends Disposable {
});
}

private basicMessage(tunnel: RemoteTunnel) {
return nls.localize('remote.tunnelsView.automaticForward', "Your application running on port {0} is available. ",
private async basicMessage(tunnel: RemoteTunnel) {
const properties = await this.remoteExplorerService.tunnelModel.getAttributes([{ host: tunnel.tunnelRemoteHost, port: tunnel.tunnelRemotePort }], false);
const label = properties?.get(tunnel.tunnelRemotePort)?.label;
return nls.localize('remote.tunnelsView.automaticForward', "Your application{0} running on port {1} is available. ",
label ? ` (${label})` : '',
tunnel.tunnelRemotePort);
}

Expand All @@ -402,7 +405,7 @@ class OnAutoForwardedAction extends Disposable {
}

this.lastNotification?.close();
let message = this.basicMessage(tunnel);
let message = await this.basicMessage(tunnel);
const choices = [this.openBrowserChoice(tunnel)];
if (!isWeb || openPreviewEnabledContext.getValue(this.contextKeyService)) {
choices.push(this.openPreviewChoice(tunnel));
Expand Down Expand Up @@ -481,7 +484,7 @@ class OnAutoForwardedAction extends Disposable {
this.lastNotification?.close();
this.lastShownPort = newTunnel.tunnelRemotePort;
this.lastNotification = this.notificationService.prompt(Severity.Info,
this.basicMessage(newTunnel) + this.linkMessage(),
await this.basicMessage(newTunnel) + this.linkMessage(),
[this.openBrowserChoice(newTunnel), this.openPreviewChoice(tunnel)],
{ neverShowAgain: { id: 'remote.tunnelsView.autoForwardNeverShow', isSecondary: true } });
this.lastNotification.onDidClose(() => {
Expand Down