disallow shell scripting in web by default

This commit is contained in:
Jan Prochazka
2022-03-20 11:17:49 +01:00
parent 6fb582249c
commit 2bec053809
11 changed files with 204 additions and 75 deletions

View File

@@ -12,6 +12,7 @@
execute: true,
toggleComment: true,
findReplace: true,
executeAdditionalCondition: () => getCurrentConfig().allowShellScripting,
});
registerCommand({
@@ -51,6 +52,7 @@
import AceEditor from '../query/AceEditor.svelte';
import RunnerOutputPane from '../query/RunnerOutputPane.svelte';
import useEditorData from '../query/useEditorData';
import { getCurrentConfig } from '../stores';
import { apiCall, apiOff, apiOn } from '../utility/api';
import { copyTextToClipboard } from '../utility/clipboard';
import { changeTab } from '../utility/common';
@@ -177,6 +179,11 @@
const resp = await apiCall('runners/start', {
script: getActiveScript(),
});
if (resp.errorMessage) {
showSnackbarError(resp.errorMessage);
return;
}
runid = resp.runid;
runnerId = runid;
busy = true;