Skip to content

Commit b897a2b

Browse files
committed
fix #443 support more ${...} variables in server menu links
1 parent 1ec1b0e commit b897a2b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,20 @@
694694
"default": false
695695
},
696696
"links": {
697-
"description": "Extra links for the server.",
697+
"description": "Extra links for the server command menu.",
698698
"type": "object",
699699
"patternProperties": {
700700
".*": {
701701
"type": "string",
702-
"format": "uri"
702+
"description": "Key is displayed on menu. Value is the uri to open. Several ${...} substitution symbols are supported in the value.",
703+
"anyOf": [
704+
{
705+
"format": "uri"
706+
},
707+
{
708+
"pattern": "^\\${serverUrl}\/.*"
709+
}
710+
]
703711
}
704712
}
705713
},

src/commands/serverActions.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ export async function serverActions(): Promise<void> {
8080
link = link
8181
.replace("${host}", host)
8282
.replace("${port}", port.toString())
83+
.replace("${serverUrl}", serverUrl)
84+
.replace("${serverAuth}", auth)
85+
.replace("${ns}", nsEncoded)
8386
.replace("${namespace}", ns == "%SYS" ? "sys" : nsEncoded.toLowerCase())
8487
.replace("${classname}", classname);
8588
actions.push({

0 commit comments

Comments
 (0)