@@ -3,7 +3,7 @@ import { config, workspaceState, checkConnection } from "../extension";
33import { currentWorkspaceFolder , terminalWithDocker } from "../utils" ;
44
55export 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" ) ;
77 const workspaceFolder = currentWorkspaceFolder ( ) ;
88 const port = workspaceState . get ( workspaceFolder + ":port" , defaultPort ) ;
99 const nsEncoded = encodeURIComponent ( ns ) ;
@@ -17,7 +17,17 @@ export async function serverActions(): Promise<void> {
1717 const auth = iris
1818 ? `&IRISUsername=${ usernameEncoded } &IRISPassword=${ passwordEncoded } `
1919 : `&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+ }
2131 const terminal = [ ] ;
2232 if ( workspaceState . get ( workspaceFolder + ":docker" , true ) ) {
2333 terminal . push ( {
@@ -29,6 +39,7 @@ export async function serverActions(): Promise<void> {
2939 return vscode . window
3040 . showQuickPick (
3141 [
42+ ...extraLinks ,
3243 {
3344 id : "refreshConnection" ,
3445 label : "Refresh connection" ,
@@ -77,6 +88,10 @@ export async function serverActions(): Promise<void> {
7788 }
7889 case "openDockerTerminal" : {
7990 terminalWithDocker ( ) ;
91+ break ;
92+ }
93+ default : {
94+ vscode . env . openExternal ( vscode . Uri . parse ( action . detail ) ) ;
8095 }
8196 }
8297 } ) ;
0 commit comments