@@ -3,7 +3,7 @@ import { config, workspaceState, checkConnection } from "../extension";
3
3
import { currentWorkspaceFolder , terminalWithDocker } from "../utils" ;
4
4
5
5
export async function serverActions ( ) : Promise < void > {
6
- const { active, host, ns, https, port : defaultPort , username, password } = config ( "conn" ) ;
6
+ const { active, host, ns, https, port : defaultPort , username, password, links } = config ( "conn" ) ;
7
7
const workspaceFolder = currentWorkspaceFolder ( ) ;
8
8
const port = workspaceState . get ( workspaceFolder + ":port" , defaultPort ) ;
9
9
const nsEncoded = encodeURIComponent ( ns ) ;
@@ -17,7 +17,17 @@ export async function serverActions(): Promise<void> {
17
17
const auth = iris
18
18
? `&IRISUsername=${ usernameEncoded } &IRISPassword=${ passwordEncoded } `
19
19
: `&CacheUserName=${ usernameEncoded } &CachePassword=${ passwordEncoded } ` ;
20
-
20
+ const extraLinks = [ ] ;
21
+ for ( const title in links ) {
22
+ const link = String ( links [ title ] )
23
+ . replace ( "${host}" , host )
24
+ . replace ( "${port}" , port ) ;
25
+ extraLinks . push ( {
26
+ id : "extraLink" + extraLinks . length ,
27
+ label : title ,
28
+ detail : link ,
29
+ } ) ;
30
+ }
21
31
const terminal = [ ] ;
22
32
if ( workspaceState . get ( workspaceFolder + ":docker" , true ) ) {
23
33
terminal . push ( {
@@ -29,6 +39,7 @@ export async function serverActions(): Promise<void> {
29
39
return vscode . window
30
40
. showQuickPick (
31
41
[
42
+ ...extraLinks ,
32
43
{
33
44
id : "refreshConnection" ,
34
45
label : "Refresh connection" ,
@@ -77,6 +88,10 @@ export async function serverActions(): Promise<void> {
77
88
}
78
89
case "openDockerTerminal" : {
79
90
terminalWithDocker ( ) ;
91
+ break ;
92
+ }
93
+ default : {
94
+ vscode . env . openExternal ( vscode . Uri . parse ( action . detail ) ) ;
80
95
}
81
96
}
82
97
} ) ;
0 commit comments