Fix: Editor dark UI

This commit is contained in:
unitwk 2024-01-05 11:46:37 +08:00
parent 8abff6590a
commit 766064750f
4 changed files with 21 additions and 15 deletions

View File

@ -13,12 +13,15 @@ import { getRandomId } from "@/tools/randId";
import * as yamlMode from "@codemirror/legacy-modes/mode/yaml"; import * as yamlMode from "@codemirror/legacy-modes/mode/yaml";
import * as propertiesMode from "@codemirror/legacy-modes/mode/properties"; import * as propertiesMode from "@codemirror/legacy-modes/mode/properties";
import * as shellMode from "@codemirror/legacy-modes/mode/shell"; import * as shellMode from "@codemirror/legacy-modes/mode/shell";
import { useScreen } from "../hooks/useScreen";
const emit = defineEmits(["update:text"]); const emit = defineEmits(["update:text"]);
const uuid = getRandomId(); const uuid = getRandomId();
const DOM_ID = `file-editor-${uuid}`; const DOM_ID = `file-editor-${uuid}`;
const { isPhone } = useScreen();
const props = defineProps<{ const props = defineProps<{
text: string; text: string;
height: string; height: string;
@ -26,15 +29,21 @@ const props = defineProps<{
}>(); }>();
const theme = EditorView.theme({ const theme = EditorView.theme({
$: {
fontSize: "12px"
},
".cm-gutters": { ".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": { ".cm-scroller": {
overflow: "hidden" overflow: "auto",
height: props.height
},
".cm-content": {
"background-color": "var(--color-gray-4)"
} }
// ".cm-content": {
// height: props.height
// },
// ".cm-wrap": { // ".cm-wrap": {
// height: props.height, // height: props.height,
// border: "1px solid silver" // border: "1px solid silver"
@ -115,13 +124,9 @@ onBeforeUnmount(() => {
</script> </script>
<template> <template>
<div class="editor-container" :style="{ height }"> <div class="editor-container">
<div :id="DOM_ID" class="file-editor"></div> <div :id="DOM_ID" class="file-editor"></div>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped></style>
.editor-container {
overflow: auto;
}
</style>

View File

@ -58,7 +58,7 @@ export function useStartCmdBuilder() {
const jarName = config.jarName.includes(" ") ? `"${config.jarName}"` : config.jarName; const jarName = config.jarName.includes(" ") ? `"${config.jarName}"` : config.jarName;
const memArray = []; const memArray = [];
if (config.minMemory) memArray.push(`-Xms${config.minMemory}`); 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]; const cmd = [javaPath, ...memArray, ...additionalArray, "-jar", jarName, config.suffix];
return cmd.join(" "); return cmd.join(" ");
} }

View File

@ -83,6 +83,7 @@ const columns = computed(() => {
customRender: (e: { text: number; record: { name: string } }) => { customRender: (e: { text: number; record: { name: string } }) => {
return e.text == 1 ? filterFileName(e.record.name) : t("TXT_CODE_e5f949c"); return e.text == 1 ? filterFileName(e.record.name) : t("TXT_CODE_e5f949c");
}, },
condition: () => !isPhone.value,
minWidth: 200 minWidth: 200
}, },
{ {

View File

@ -83,7 +83,7 @@ const cancel = () => {
}; };
const dialogTitle = computed(() => { const dialogTitle = computed(() => {
return `${t("TXT_CODE_b0dc1f17")} ${fileName.value}`; return fileName.value;
}); });
defineExpose({ defineExpose({
@ -99,7 +99,7 @@ defineExpose({
:ok-text="t('TXT_CODE_abfe9512')" :ok-text="t('TXT_CODE_abfe9512')"
:mask-closable="false" :mask-closable="false"
:title="dialogTitle" :title="dialogTitle"
width="1000px" width="1300px"
@ok="submit()" @ok="submit()"
@cancel="cancel()" @cancel="cancel()"
> >
@ -108,7 +108,7 @@ defineExpose({
ref="EditorComponent" ref="EditorComponent"
v-model:text="editorText" v-model:text="editorText"
:filename="fileName" :filename="fileName"
height="70vh" height="80vh"
/> />
<a-skeleton v-else :paragraph="{ rows: 12 }" active /> <a-skeleton v-else :paragraph="{ rows: 12 }" active />
</a-modal> </a-modal>