From 67db444e3a3f6a14a65c28349e5efad38e4e9658 Mon Sep 17 00:00:00 2001 From: Yanni Date: Fri, 17 Mar 2023 15:08:05 -0400 Subject: [PATCH 1/3] add pathPrefix prompt --- package-lock.json | 2 +- src/api/addServer.ts | 15 +++++++++++++++ types/index.d.ts | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 48c9667..0158b6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "tough-cookie": "^4.0.0" }, "devDependencies": { - "@intersystems-community/intersystems-servermanager": "*", + "@intersystems-community/intersystems-servermanager": "latest", "@types/glob": "^7.1.1", "@types/keytar": "^4.4.2", "@types/mocha": "^9.0.0", diff --git a/src/api/addServer.ts b/src/api/addServer.ts index 3d4b980..0d6e1f6 100644 --- a/src/api/addServer.ts +++ b/src/api/addServer.ts @@ -59,6 +59,21 @@ export async function addServer( }); if (portString) { spec.webServer.port = +portString; + const prefix = await vscode.window.showInputBox({ + ignoreFocusOut: true, + placeHolder: + "Optional path prefix of instance", + }); + if (typeof prefix !== "undefined") { + if (prefix) { + var pathPrefix = prefix.trim(); + if (pathPrefix.charAt(0) !== '/') { + pathPrefix = '/' + pathPrefix; + } + spec.webServer.pathPrefix = pathPrefix; + } + } + const username = await vscode.window.showInputBox({ ignoreFocusOut: true, placeHolder: diff --git a/types/index.d.ts b/types/index.d.ts index f2db922..70a504c 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -19,6 +19,7 @@ export interface IJSONServerSpec { username?: string; password?: string; description?: string; + pathPrefix?: string; } export interface IServerSpec extends IJSONServerSpec { From 391ad8fc8b620a28dec57797383084b5dc599696 Mon Sep 17 00:00:00 2001 From: Yanni Pang Date: Fri, 17 Mar 2023 23:02:36 -0400 Subject: [PATCH 2/3] remove pathPrefix from interface --- types/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 70a504c..f2db922 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -19,7 +19,6 @@ export interface IJSONServerSpec { username?: string; password?: string; description?: string; - pathPrefix?: string; } export interface IServerSpec extends IJSONServerSpec { From 3889797ee6312d20f5a0d361714d338bb34e85a8 Mon Sep 17 00:00:00 2001 From: Yanni Pang Date: Fri, 17 Mar 2023 23:03:37 -0400 Subject: [PATCH 3/3] switch from single quotes to double quotes for consistency --- src/api/addServer.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/addServer.ts b/src/api/addServer.ts index 0d6e1f6..e014296 100644 --- a/src/api/addServer.ts +++ b/src/api/addServer.ts @@ -67,8 +67,8 @@ export async function addServer( if (typeof prefix !== "undefined") { if (prefix) { var pathPrefix = prefix.trim(); - if (pathPrefix.charAt(0) !== '/') { - pathPrefix = '/' + pathPrefix; + if (pathPrefix.charAt(0) !== "/") { + pathPrefix = "/" + pathPrefix; } spec.webServer.pathPrefix = pathPrefix; }