From 766064750fe603f181e89f9a013a32f9c0903452 Mon Sep 17 00:00:00 2001 From: unitwk Date: Fri, 5 Jan 2024 11:46:37 +0800 Subject: [PATCH] Fix: Editor dark UI --- frontend/src/components/Editor.vue | 27 +++++++++++-------- frontend/src/hooks/useGenerateStartCmd.ts | 2 +- frontend/src/widgets/instance/FileManager.vue | 1 + .../widgets/instance/dialogs/FileEditor.vue | 6 ++--- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/Editor.vue b/frontend/src/components/Editor.vue index f0ce2b4f..f61ff457 100644 --- a/frontend/src/components/Editor.vue +++ b/frontend/src/components/Editor.vue @@ -13,12 +13,15 @@ import { getRandomId } from "@/tools/randId"; import * as yamlMode from "@codemirror/legacy-modes/mode/yaml"; import * as propertiesMode from "@codemirror/legacy-modes/mode/properties"; import * as shellMode from "@codemirror/legacy-modes/mode/shell"; +import { useScreen } from "../hooks/useScreen"; const emit = defineEmits(["update:text"]); const uuid = getRandomId(); const DOM_ID = `file-editor-${uuid}`; +const { isPhone } = useScreen(); + const props = defineProps<{ text: string; height: string; @@ -26,15 +29,21 @@ const props = defineProps<{ }>(); const theme = EditorView.theme({ + $: { + fontSize: "12px" + }, ".cm-gutters": { - height: props.height + "background-color": "var(--color-gray-4)", + display: isPhone.value ? "none" : "block", + "border-right": "1px solid var(--color-gray-5)" }, ".cm-scroller": { - overflow: "hidden" + overflow: "auto", + height: props.height + }, + ".cm-content": { + "background-color": "var(--color-gray-4)" } - // ".cm-content": { - // height: props.height - // }, // ".cm-wrap": { // height: props.height, // border: "1px solid silver" @@ -115,13 +124,9 @@ onBeforeUnmount(() => { - + diff --git a/frontend/src/hooks/useGenerateStartCmd.ts b/frontend/src/hooks/useGenerateStartCmd.ts index 8c4440e9..e7a3817e 100644 --- a/frontend/src/hooks/useGenerateStartCmd.ts +++ b/frontend/src/hooks/useGenerateStartCmd.ts @@ -58,7 +58,7 @@ export function useStartCmdBuilder() { const jarName = config.jarName.includes(" ") ? `"${config.jarName}"` : config.jarName; const memArray = []; if (config.minMemory) memArray.push(`-Xms${config.minMemory}`); - if (config.maxMemory) memArray.push(`-Xms${config.maxMemory}`); + if (config.maxMemory) memArray.push(`-Xmx${config.maxMemory}`); const cmd = [javaPath, ...memArray, ...additionalArray, "-jar", jarName, config.suffix]; return cmd.join(" "); } diff --git a/frontend/src/widgets/instance/FileManager.vue b/frontend/src/widgets/instance/FileManager.vue index 7b159775..3656b098 100644 --- a/frontend/src/widgets/instance/FileManager.vue +++ b/frontend/src/widgets/instance/FileManager.vue @@ -83,6 +83,7 @@ const columns = computed(() => { customRender: (e: { text: number; record: { name: string } }) => { return e.text == 1 ? filterFileName(e.record.name) : t("TXT_CODE_e5f949c"); }, + condition: () => !isPhone.value, minWidth: 200 }, { diff --git a/frontend/src/widgets/instance/dialogs/FileEditor.vue b/frontend/src/widgets/instance/dialogs/FileEditor.vue index fd545968..83c48aac 100644 --- a/frontend/src/widgets/instance/dialogs/FileEditor.vue +++ b/frontend/src/widgets/instance/dialogs/FileEditor.vue @@ -83,7 +83,7 @@ const cancel = () => { }; const dialogTitle = computed(() => { - return `${t("TXT_CODE_b0dc1f17")} ${fileName.value}`; + return fileName.value; }); defineExpose({ @@ -99,7 +99,7 @@ defineExpose({ :ok-text="t('TXT_CODE_abfe9512')" :mask-closable="false" :title="dialogTitle" - width="1000px" + width="1300px" @ok="submit()" @cancel="cancel()" > @@ -108,7 +108,7 @@ defineExpose({ ref="EditorComponent" v-model:text="editorText" :filename="fileName" - height="70vh" + height="80vh" />