Skip to content

Commit 9293111

Browse files
Merge pull request #82 from gjsjohnmurray/add-webapps
'Alt' commands on the Edit and View buttons, for accessing web application files
2 parents f3adb75 + bfa4793 commit 9293111

File tree

2 files changed

+73
-5
lines changed

2 files changed

+73
-5
lines changed

package.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,16 @@
314314
"command": "intersystems-community.servermanager.viewNamespace",
315315
"title": "View Code in Namespace",
316316
"icon": "$(eye)"
317+
},
318+
{
319+
"command": "intersystems-community.servermanager.editNamespaceWebAppFiles",
320+
"title": "Edit Web Application Files",
321+
"icon": "$(file-code)"
322+
},
323+
{
324+
"command": "intersystems-community.servermanager.viewNamespaceWebAppFiles",
325+
"title": "View Web Application Files",
326+
"icon": "$(telescope)"
317327
}
318328
],
319329
"submenus": [
@@ -373,6 +383,54 @@
373383
{
374384
"command": "intersystems-community.servermanager.openPortalTab",
375385
"when": "false"
386+
},
387+
{
388+
"command": "intersystems-community.servermanager.retryServer",
389+
"when": "false"
390+
},
391+
{
392+
"command": "intersystems-community.servermanager.setIconRed",
393+
"when": "false"
394+
},
395+
{
396+
"command": "intersystems-community.servermanager.setIconOrange",
397+
"when": "false"
398+
},
399+
{
400+
"command": "intersystems-community.servermanager.setIconYellow",
401+
"when": "false"
402+
},
403+
{
404+
"command": "intersystems-community.servermanager.setIconGreen",
405+
"when": "false"
406+
},
407+
{
408+
"command": "intersystems-community.servermanager.setIconBlue",
409+
"when": "false"
410+
},
411+
{
412+
"command": "intersystems-community.servermanager.setIconPurple",
413+
"when": "false"
414+
},
415+
{
416+
"command": "intersystems-community.servermanager.resetIconColor",
417+
"when": "false"
418+
},
419+
{
420+
"command": "intersystems-community.servermanager.editNamespace",
421+
"when": "false"
422+
},
423+
{
424+
"command": "intersystems-community.servermanager.viewNamespace",
425+
"when": "false"
426+
},
427+
{
428+
"command": "intersystems-community.servermanager.editNamespaceWebAppFiles",
429+
"when": "false"
430+
},
431+
{
432+
"command": "intersystems-community.servermanager.viewNamespaceWebAppFiles",
433+
"when": "false"
376434
}
377435
],
378436
"view/title": [
@@ -420,11 +478,13 @@
420478
},
421479
{
422480
"command": "intersystems-community.servermanager.editNamespace",
481+
"alt": "intersystems-community.servermanager.editNamespaceWebAppFiles",
423482
"when": "view == intersystems-community_servermanager && viewItem =~ /namespace$/",
424483
"group": "inline@10"
425484
},
426485
{
427486
"command": "intersystems-community.servermanager.viewNamespace",
487+
"alt": "intersystems-community.servermanager.viewNamespaceWebAppFiles",
428488
"when": "view == intersystems-community_servermanager && viewItem =~ /namespace$/",
429489
"group": "inline@20"
430490
},

src/extension.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export function activate(context: vscode.ExtensionContext) {
205205
})
206206
);
207207

208-
const addWorkspaceFolderAsync = async (readonly: boolean, namespaceTreeItem?: ServerTreeItem) => {
208+
const addWorkspaceFolderAsync = async (readonly: boolean, csp: boolean, namespaceTreeItem?: ServerTreeItem) => {
209209
if (namespaceTreeItem) {
210210
const pathParts = namespaceTreeItem.id?.split(':');
211211
if (pathParts && pathParts.length === 4) {
@@ -229,9 +229,9 @@ export function activate(context: vscode.ExtensionContext) {
229229
return;
230230
}
231231

232-
const uri = vscode.Uri.parse(`isfs${readonly ? "-readonly" : ""}://${serverName}:${namespace}/${serverSpec.webServer.pathPrefix || ''}`);
232+
const uri = vscode.Uri.parse(`isfs${readonly ? "-readonly" : ""}://${serverName}:${namespace}/${serverSpec.webServer.pathPrefix || ''}${csp ? '?csp' : ''}`);
233233
if ((vscode.workspace.workspaceFolders || []).filter((workspaceFolder) => workspaceFolder.uri.toString() === uri.toString()).length === 0) {
234-
const label = `${serverName}:${namespace}${readonly ? " (read-only)" : ""}`;
234+
const label = `${serverName}:${namespace}${csp ? ' webfiles' : ''}${readonly ? " (read-only)" : ""}`;
235235
const added = vscode.workspace.updateWorkspaceFolders(
236236
vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders.length : 0,
237237
0,
@@ -253,11 +253,19 @@ export function activate(context: vscode.ExtensionContext) {
253253
}
254254

255255
context.subscriptions.push(
256-
vscode.commands.registerCommand(`${extensionId}.editNamespace`, async (namespaceTreeItem?: ServerTreeItem) => {await addWorkspaceFolderAsync(false, namespaceTreeItem)})
256+
vscode.commands.registerCommand(`${extensionId}.editNamespace`, async (namespaceTreeItem?: ServerTreeItem) => {await addWorkspaceFolderAsync(false, false, namespaceTreeItem)})
257257
);
258258

259259
context.subscriptions.push(
260-
vscode.commands.registerCommand(`${extensionId}.viewNamespace`, async (namespaceTreeItem?: ServerTreeItem) => {await addWorkspaceFolderAsync(true, namespaceTreeItem)})
260+
vscode.commands.registerCommand(`${extensionId}.viewNamespace`, async (namespaceTreeItem?: ServerTreeItem) => {await addWorkspaceFolderAsync(true, false, namespaceTreeItem)})
261+
);
262+
263+
context.subscriptions.push(
264+
vscode.commands.registerCommand(`${extensionId}.editNamespaceWebAppFiles`, async (namespaceTreeItem?: ServerTreeItem) => {await addWorkspaceFolderAsync(false, true, namespaceTreeItem)})
265+
);
266+
267+
context.subscriptions.push(
268+
vscode.commands.registerCommand(`${extensionId}.viewNamespaceWebAppFiles`, async (namespaceTreeItem?: ServerTreeItem) => {await addWorkspaceFolderAsync(true, true, namespaceTreeItem)})
261269
);
262270

263271
// Listen for relevant configuration changes

0 commit comments

Comments
 (0)