feat: Add YAML format to CodeMirror (#7326)

Refs #7274
pull/7333/head
ssongliu 2024-12-11 15:47:43 +08:00 committed by GitHub
parent 335a82332f
commit f5de005ad7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 8 deletions

View File

@ -21,6 +21,7 @@
},
"dependencies": {
"@codemirror/lang-html": "^6.4.9",
"@codemirror/lang-yaml": "^6.1.2",
"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/lang-php": "^6.0.1",
"@codemirror/language": "^6.10.2",

View File

@ -153,14 +153,14 @@ import { useRouter } from 'vue-router';
import Params from '../params/index.vue';
import Header from '@/components/drawer-header/index.vue';
import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript';
import { yaml } from '@codemirror/lang-yaml';
import { oneDark } from '@codemirror/theme-one-dark';
import i18n from '@/lang';
import { MsgError } from '@/utils/message';
import { Container } from '@/api/interface/container';
import { loadResourceLimit } from '@/api/modules/container';
const extensions = [javascript(), oneDark];
const extensions = [yaml(), oneDark];
const router = useRouter();
interface InstallRrops {

View File

@ -151,13 +151,13 @@ import { Rules, checkNumberRange } from '@/global/form-rules';
import { MsgSuccess } from '@/utils/message';
import i18n from '@/lang';
import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript';
import { yaml } from '@codemirror/lang-yaml';
import { oneDark } from '@codemirror/theme-one-dark';
import { getLanguage } from '@/utils/util';
import { Container } from '@/api/interface/container';
import { loadResourceLimit } from '@/api/modules/container';
const extensions = [javascript(), oneDark];
const extensions = [yaml(), oneDark];
interface ParamProps {
id: Number;

View File

@ -135,10 +135,10 @@ import DrawerHeader from '@/components/drawer-header/index.vue';
import { listComposeTemplate, testCompose, upCompose } from '@/api/modules/container';
import { loadBaseDir } from '@/api/modules/setting';
import { MsgError } from '@/utils/message';
import { javascript } from '@codemirror/lang-javascript';
import { yaml } from '@codemirror/lang-yaml';
import { oneDark } from '@codemirror/theme-one-dark';
const extensions = [javascript(), oneDark];
const extensions = [yaml(), oneDark];
const showLog = ref(false);
const loading = ref();

View File

@ -75,7 +75,7 @@
</template>
<script lang="ts" setup>
import { Codemirror } from 'vue-codemirror';
import { javascript } from '@codemirror/lang-javascript';
import { yaml } from '@codemirror/lang-yaml';
import { oneDark } from '@codemirror/theme-one-dark';
import { ref } from 'vue';
import { composeUpdate } from '@/api/modules/container';
@ -87,7 +87,7 @@ import { ElForm } from 'element-plus';
const emit = defineEmits<{ (e: 'search'): void }>();
const loading = ref(false);
const composeVisible = ref(false);
const extensions = [javascript(), oneDark];
const extensions = [yaml(), oneDark];
const path = ref();
const content = ref();
const name = ref();