Skip to content

Commit

Permalink
Show the devcontainer label value specified in portsAttributes within…
Browse files Browse the repository at this point in the history
… the port notification instead of "your application" (#200667)

Fixes #192684
  • Loading branch information
alexr00 authored Dec 12, 2023
1 parent dc3b949 commit 40f2a58
Showing 1 changed file with 7 additions and 4 deletions.
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

0 comments on commit 40f2a58

Please sign in to comment.