1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 00:09:16 +08:00

feat: CornJob shell script syntax highlighting (#7357)

This commit is contained in:
刘瑞斌 2024-12-13 21:31:58 +08:00 committed by GitHub
parent 0d988bbd6a
commit 96329967ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,7 +207,18 @@
</el-form-item>
<el-form-item v-if="hasScript()" :label="$t('cronjob.shellContent')" prop="script">
<el-input clearable type="textarea" :rows="5" v-model="dialogData.rowData!.script" />
<codemirror
:autofocus="true"
:indent-with-tab="true"
:tabSize="4"
:lineWrapping="true"
style="width: 100%; margin-top: 5px"
theme="cobalt"
:styleActiveLine="true"
:matchBrackets="true"
:extensions="extensions"
v-model="dialogData.rowData!.script"
/>
</el-form-item>
<el-form-item
@ -440,6 +451,11 @@ import { loadDefaultSpec, specOptions, transObjToSpec, transSpecToObj, weekOptio
import { storeToRefs } from 'pinia';
import { GlobalStore } from '@/store';
import LicenseImport from '@/components/license-import/index.vue';
import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript';
import { oneDark } from '@codemirror/theme-one-dark';
const extensions = [javascript(), oneDark];
const router = useRouter();