diff --git a/src/commands/restDebugPanel.ts b/src/commands/restDebugPanel.ts index 88eb6d31..072a78dc 100644 --- a/src/commands/restDebugPanel.ts +++ b/src/commands/restDebugPanel.ts @@ -1,9 +1,8 @@ import axios from "axios"; import * as httpsModule from "https"; - import * as vscode from "vscode"; import { AtelierAPI } from "../api"; -import { cspAppsForUri, handleError } from "../utils"; +import { handleError } from "../utils"; import { iscIcon } from "../extension"; interface WebviewMessage { @@ -83,24 +82,6 @@ export class RESTDebugPanel { return; } - // Build the list of all non-CSP web apps - const cspWebApps: string[] = cspAppsForUri(openEditor.document.uri); - const allWebApps: string[] | null = await api - .actionQuery("CALL %CSP.Apps_CSPAppList()", []) - .then((data) => data.result.content.map((obj) => obj.AppUrl)) - .catch((error) => { - handleError(error, "Failed to fetch the list of web applications from the server."); - return null; - }); - if (allWebApps == null) { - return; - } - const restWebApps = allWebApps.filter((app) => !cspWebApps.includes(app)); - if (restWebApps.length == 0) { - vscode.window.showErrorMessage("No REST web applications are configured in the server's namespace.", "Dismiss"); - return; - } - if (this.currentPanel !== undefined) { // Can only have one panel open at once if (!this.currentPanel._panel.visible) { @@ -133,10 +114,10 @@ export class RESTDebugPanel { panel.iconPath = iscIcon; this._file = openEditor.document.uri; - this.currentPanel = new RESTDebugPanel(panel, webviewFolderUri, api, restWebApps); + this.currentPanel = new RESTDebugPanel(panel, webviewFolderUri, api); } - private constructor(panel: vscode.WebviewPanel, webviewFolderUri: vscode.Uri, api: AtelierAPI, webApps: string[]) { + private constructor(panel: vscode.WebviewPanel, webviewFolderUri: vscode.Uri, api: AtelierAPI) { this._panel = panel; const serverInfo = `${api.config.https ? "https" : "http"}://${api.config.host}:${api.config.port}${ api.config.pathPrefix @@ -153,12 +134,7 @@ export class RESTDebugPanel { vscode.Uri.joinPath(webviewFolderUri, "elements-1.6.3.js") )}"> ${RESTDebugPanel._viewTitle} -