Skip to content

Commit 1ac3a7c

Browse files
committed
Improve vscode_execute_command_gitpod_ports event
1 parent fe7acca commit 1ac3a7c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

extensions/gitpod-shared/src/analytics.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ export type GitpodAnalyticsEvent =
3838
action: 'share' | 'stop-sharing' | 'stop' | 'snapshot' | 'extend-timeout';
3939
}> |
4040
GAET<'vscode_execute_command_gitpod_ports', {
41-
action: 'private' | 'public' | 'preview' | 'openBrowser';
41+
action: 'private' | 'public' | 'preview' | 'openBrowser' | 'urlCopy';
4242
isWebview?: boolean;
43+
userOverride?: string; // 'true' | 'false'
4344
}> |
4445
GAET<'vscode_execute_command_gitpod_config', {
4546
action: 'remove' | 'add';

extensions/gitpod-web/portsview/src/porttable/PortLocalAddress.svelte

+7-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
function onHoverCommand(command: string) {
3737
dispatch("command", { command: command as PortCommand, port });
3838
}
39+
function openAddr(e: Event) {
40+
e.preventDefault();
41+
if (port.status.exposed.url) {
42+
dispatch("command", { command: "openBrowser" as PortCommand, port });
43+
}
44+
}
3945
</script>
4046

4147
<HoverOptions
@@ -45,7 +51,7 @@
4551
onHoverCommand(e.detail);
4652
}}
4753
>
48-
<a href={port.status.exposed.url}>{port.status.exposed.url}</a>
54+
<a on:click={(e) => { openAddr(e) }} href={port.status.exposed.url}>{port.status.exposed.url}</a>
4955
</HoverOptions>
5056

5157
<style>

0 commit comments

Comments
 (0)