Skip to content

Commit df72c98

Browse files
committed
fix #510 respect pathPrefix on server action URLs
1 parent 191691d commit df72c98

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/api/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ export class AtelierAPI {
315315
}
316316
await this.updateCookies(response.headers.raw()["set-cookie"] || []);
317317
panel.text = `${this.connInfo}`;
318-
panel.tooltip = `Connected as ${username}`;
318+
panel.tooltip = `Connected${pathPrefix ? " to " + pathPrefix : ""} as ${username}`;
319319
if (method === "HEAD") {
320320
authRequestMap.delete(target);
321321
return this.cookies;

src/commands/serverActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type ServerAction = { detail: string; id: string; label: string };
1515
export async function serverActions(): Promise<void> {
1616
const { apiTarget, configName: workspaceFolder } = connectionTarget();
1717
const api = new AtelierAPI(apiTarget);
18-
const { active, host = "", ns = "", https, port = 0, username, password, docker } = api.config;
18+
const { active, host = "", ns = "", https, port = 0, pathPrefix, username, password, docker } = api.config;
1919
const explorerCount = (await explorerProvider.getChildren()).length;
2020
if (!explorerCount && (!docker || host === "")) {
2121
await vscode.commands.executeCommand("ObjectScriptExplorer.focus");
@@ -71,7 +71,7 @@ export async function serverActions(): Promise<void> {
7171
const classname = file && file.name.toLowerCase().endsWith(".cls") ? file.name.slice(0, -4) : "";
7272
const classnameEncoded = encodeURIComponent(classname);
7373
const connInfo = `${host}:${port}[${nsEncoded}]`;
74-
const serverUrl = `${https ? "https" : "http"}://${host}:${port}`;
74+
const serverUrl = `${https ? "https" : "http"}://${host}:${port}${pathPrefix}`;
7575
const portalUrl = `${serverUrl}/csp/sys/UtilHome.csp?$NAMESPACE=${nsEncoded}`;
7676
const classRef = `${serverUrl}/csp/documatic/%25CSP.Documatic.cls?LIBRARY=${nsEncoded}${
7777
classname ? "&CLASSNAME=" + classnameEncoded : ""

src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
199199
_onDidChangeConnection.fire();
200200
}
201201
let api = new AtelierAPI(apiTarget, false);
202-
const { active, host = "", port = 0, username, ns = "" } = api.config;
202+
const { active, host = "", port = 0, pathPrefix, username, ns = "" } = api.config;
203203
vscode.commands.executeCommand("setContext", "vscode-objectscript.connectActive", active);
204204
if (!panel.text) {
205205
panel.text = `${PANEL_LABEL}`;
@@ -268,7 +268,7 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
268268
.serverInfo()
269269
.then((info) => {
270270
panel.text = api.connInfo;
271-
panel.tooltip = `Connected as ${username}`;
271+
panel.tooltip = `Connected${pathPrefix ? " to " + pathPrefix : ""} as ${username}`;
272272
const hasHS = info.result.content.features.find((el) => el.name === "HEALTHSHARE" && el.enabled) !== undefined;
273273
reporter &&
274274
reporter.sendTelemetryEvent("connected", {

0 commit comments

Comments
 (0)