Skip to content

Commit 266edb3

Browse files
committed
1 parent 8612f77 commit 266edb3

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

gitpod-web/src/extension.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import { GitpodExtensionContext, setupGitpodContext, registerTasks, registerIpcHookCli, ExposedServedGitpodWorkspacePort, GitpodWorkspacePort, isExposedServedGitpodWorkspacePort } from 'gitpod-shared';
66
import { PortsStatus, PortVisibility } from '@gitpod/supervisor-api-grpc/lib/status_pb';
7-
import { TunnelVisiblity} from '@gitpod/supervisor-api-grpc/lib/port_pb';
7+
import { TunnelVisiblity } from '@gitpod/supervisor-api-grpc/lib/port_pb';
88
import type * as keytarType from 'keytar';
99
import fetch from 'node-fetch';
1010
import * as vscode from 'vscode';
@@ -313,21 +313,27 @@ async function registerPorts(context: GitpodExtensionContext): Promise<void> {
313313
const portsStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right);
314314
context.subscriptions.push(portsStatusBarItem);
315315
async function updateStatusBar(): Promise<void> {
316-
const exposedPorts: number[] = [];
316+
const publicExposedPorts: number[] = [];
317+
const privateExposedPorts: number[] = [];
317318

318319
for (const port of portMap.values()) {
319320
if (isExposedServedGitpodWorkspacePort(port)) {
320-
exposedPorts.push(port.status.localPort);
321+
if (port.status.exposed.visibility === PortVisibility.PUBLIC) {
322+
publicExposedPorts.push(port.status.localPort);
323+
} else {
324+
privateExposedPorts.push(port.status.localPort);
325+
}
321326
}
322327
}
323328

324329
let text: string;
325330
let tooltip = 'Click to open "Ports View"';
326-
if (exposedPorts.length) {
331+
if (publicExposedPorts.length + privateExposedPorts.length) {
327332
text = 'Ports:';
328333
tooltip += '\n\nPorts';
329-
text += ` ${exposedPorts.join(', ')}`;
330-
tooltip += `\nPublic: ${exposedPorts.join(', ')}`;
334+
text += ` ${[...publicExposedPorts, ...privateExposedPorts].join(', ')}`;
335+
tooltip += publicExposedPorts.length ? `\nPublic: ${publicExposedPorts.join(', ')}` : '';
336+
tooltip += privateExposedPorts.length ? `\nPrivate: ${privateExposedPorts.join(', ')}` : '';
331337
} else {
332338
text = '$(circle-slash) No open ports';
333339
}

0 commit comments

Comments
 (0)