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 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(() => {
</script>
<template>
<div class="editor-container" :style="{ height }">
<div class="editor-container">
<div :id="DOM_ID" class="file-editor"></div>
</div>
</template>
<style lang="scss" scoped>
.editor-container {
overflow: auto;
}
</style>
<style lang="scss" scoped></style>

View File

@ -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(" ");
}

View File

@ -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
},
{

View File

@ -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"
/>
<a-skeleton v-else :paragraph="{ rows: 12 }" active />
</a-modal>