Skip to content

Commit 5b061ca

Browse files
committed
Launching CSP pages with server manager settings
1 parent 20bcbf9 commit 5b061ca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/commands/studio.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ class StudioActions {
104104
case 2: // Run a CSP page/Template. The Target is the full url to the CSP page/Template
105105
return new Promise((resolve) => {
106106
let answer = "2";
107-
const conn = config().conn;
108107
const column = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.viewColumn : undefined;
109108
const panel = vscode.window.createWebviewPanel(
110109
"studioactionwebview",
@@ -122,14 +121,15 @@ class StudioActions {
122121
});
123122
panel.onDidDispose(() => resolve(answer));
124123

125-
const url = new URL(`http://${conn.host}:${conn.port}${target}`);
126-
const api = new AtelierAPI();
127-
api
124+
const url = new URL(
125+
`${this.api.config.https ? "https" : "http"}://${this.api.config.host}:${this.api.config.port}${target}`
126+
);
127+
this.api
128128
.actionQuery("select %Atelier_v1_Utils.General_GetCSPToken(?) token", [url.toString()])
129129
.then((tokenObj) => {
130130
const csptoken = tokenObj.result.content[0].token;
131131
url.searchParams.set("CSPCHD", csptoken);
132-
url.searchParams.set("Namespace", conn.ns);
132+
url.searchParams.set("Namespace", this.api.config.ns);
133133
panel.webview.html = `
134134
<!DOCTYPE html>
135135
<html lang="en">

0 commit comments

Comments
 (0)