From 9e44db53a713e24dec24e2fcc42f8474bb86b433 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:59:14 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E7=9A=84=E9=AB=98=E5=BA=A6=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#4534)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/container.go | 1 - .../src/components/container-log/index.vue | 8 ++++++- .../src/views/container/setting/index.vue | 8 ++++++- .../views/database/mysql/setting/index.vue | 8 ++++++- .../database/mysql/setting/slow-log/index.vue | 15 +++++++++++- .../database/postgresql/setting/index.vue | 8 ++++++- frontend/src/views/database/redis/index.vue | 8 ++++++- .../views/database/redis/setting/index.vue | 8 ++++++- .../views/host/terminal/terminal/index.vue | 23 +++++++++++++++---- 9 files changed, 75 insertions(+), 12 deletions(-) diff --git a/backend/app/service/container.go b/backend/app/service/container.go index 88769f711..504e6e4f3 100644 --- a/backend/app/service/container.go +++ b/backend/app/service/container.go @@ -656,7 +656,6 @@ func (u *ContainerService) ContainerLogs(wsConn *websocket.Conn, containerType, commandArg = append(commandArg, "-f") } if !follow { - commandArg = append(commandArg, "2>&1") cmd := exec.Command(commandName, commandArg...) stdout, _ := cmd.CombinedOutput() if !utf8.Valid(stdout) { diff --git a/frontend/src/components/container-log/index.vue b/frontend/src/components/container-log/index.vue index ea62755c4..c4e46294d 100644 --- a/frontend/src/components/container-log/index.vue +++ b/frontend/src/components/container-log/index.vue @@ -31,7 +31,7 @@ :placeholder="$t('commons.msg.noneData')" :indent-with-tab="true" :tabSize="4" - style="margin-top: 10px; height: calc(100vh - 375px)" + :style="{ height: `calc(100vh - ${loadHeight()})`, 'margin-top': '10px' }" :lineWrapping="true" :matchBrackets="true" theme="cobalt" @@ -53,6 +53,8 @@ import { Codemirror } from 'vue-codemirror'; import { javascript } from '@codemirror/lang-javascript'; import { oneDark } from '@codemirror/theme-one-dark'; import { MsgError, MsgSuccess } from '@/utils/message'; +import { GlobalStore } from '@/store'; +const globalStore = GlobalStore(); const extensions = [javascript(), oneDark]; @@ -63,6 +65,10 @@ const handleReady = (payload) => { }; const terminalSocket = ref(); +const loadHeight = () => { + return globalStore.openMenuTabs ? '405px' : '375px'; +}; + const logSearch = reactive({ isWatch: false, container: '', diff --git a/frontend/src/views/container/setting/index.vue b/frontend/src/views/container/setting/index.vue index 051042172..d6db97e02 100644 --- a/frontend/src/views/container/setting/index.vue +++ b/frontend/src/views/container/setting/index.vue @@ -170,7 +170,7 @@ placeholder="# The Docker configuration file does not exist or is empty (/etc/docker/daemon.json)" :indent-with-tab="true" :tabSize="4" - style="margin-top: 10px; height: calc(100vh - 430px)" + :style="{ height: `calc(100vh - ${loadHeight()})`, 'margin-top': '10px' }" :lineWrapping="true" :matchBrackets="true" theme="cobalt" @@ -264,6 +264,8 @@ import { import { getSettingInfo } from '@/api/modules/setting'; import { MsgSuccess } from '@/utils/message'; import { checkNumberRange } from '@/global/form-rules'; +import { GlobalStore } from '@/store'; +const globalStore = GlobalStore(); const unset = ref(i18n.global.t('setting.unSetting')); const submitInput = ref(); @@ -326,6 +328,10 @@ const onSaveFile = async () => { confirmDialogRefFile.value!.acceptParams(params); }; +const loadHeight = () => { + return globalStore.openMenuTabs ? '450px' : '430px'; +}; + const onChangeMirrors = () => { mirrorRef.value.acceptParams({ mirrors: form.mirrors }); }; diff --git a/frontend/src/views/database/mysql/setting/index.vue b/frontend/src/views/database/mysql/setting/index.vue index c9208c1df..accf8fe39 100644 --- a/frontend/src/views/database/mysql/setting/index.vue +++ b/frontend/src/views/database/mysql/setting/index.vue @@ -57,7 +57,7 @@ :placeholder="$t('commons.msg.noneData')" :indent-with-tab="true" :tabSize="4" - style="margin-top: 10px; height: calc(100vh - 375px)" + :style="{ height: `calc(100vh - ${loadHeight()})`, 'margin-top': '10px' }" :lineWrapping="true" :matchBrackets="true" theme="cobalt" @@ -153,6 +153,8 @@ import { Rules } from '@/global/form-rules'; import i18n from '@/lang'; import { MsgSuccess } from '@/utils/message'; import router from '@/routers'; +import { GlobalStore } from '@/store'; +const globalStore = GlobalStore(); const loading = ref(false); @@ -196,6 +198,10 @@ const jumpToConf = async () => { loadMysqlConf(); }; +const loadHeight = () => { + return globalStore.openMenuTabs ? '405px' : '375px'; +}; + const jumpToSlowlog = async () => { activeName.value = 'slowLog'; loadSlowLogs(); diff --git a/frontend/src/views/database/mysql/setting/slow-log/index.vue b/frontend/src/views/database/mysql/setting/slow-log/index.vue index 256c18914..6f70758c9 100644 --- a/frontend/src/views/database/mysql/setting/slow-log/index.vue +++ b/frontend/src/views/database/mysql/setting/slow-log/index.vue @@ -56,6 +56,8 @@ import { loadDBFile, updateMysqlVariables } from '@/api/modules/database'; import { dateFormatForName, downloadWithContent } from '@/utils/util'; import i18n from '@/lang'; import { MsgError, MsgInfo, MsgSuccess } from '@/utils/message'; +import { GlobalStore } from '@/store'; +const globalStore = GlobalStore(); const extensions = [javascript(), oneDark]; const slowLogs = ref(); @@ -120,7 +122,18 @@ const handleSlowLogs = async () => { }; const getDynamicHeight = () => { - return variables.slow_query_log === 'ON' ? `calc(100vh - 437px)` : `calc(100vh - 383px)`; + if (variables.slow_query_log === 'ON') { + if (globalStore.openMenuTabs) { + return `calc(100vh - 467px)`; + } else { + return `calc(100vh - 437px)`; + } + } + if (globalStore.openMenuTabs) { + return `calc(100vh - 413px)`; + } else { + return `calc(100vh - 383px)`; + } }; const changeSlowLogs = () => { diff --git a/frontend/src/views/database/postgresql/setting/index.vue b/frontend/src/views/database/postgresql/setting/index.vue index 08c5fb32d..1c95df932 100644 --- a/frontend/src/views/database/postgresql/setting/index.vue +++ b/frontend/src/views/database/postgresql/setting/index.vue @@ -33,7 +33,7 @@ :placeholder="$t('commons.msg.noneData')" :indent-with-tab="true" :tabSize="8" - style="margin-top: 10px; height: calc(100vh - 375px)" + :style="{ height: `calc(100vh - ${loadHeight()})`, 'margin-top': '10px' }" :lineWrapping="true" :matchBrackets="true" theme="cobalt" @@ -104,6 +104,8 @@ import { Rules } from '@/global/form-rules'; import i18n from '@/lang'; import { MsgSuccess } from '@/utils/message'; import router from '@/routers'; +import { GlobalStore } from '@/store'; +const globalStore = GlobalStore(); const loading = ref(false); @@ -134,6 +136,10 @@ const props = withDefaults(defineProps(), { database: '', }); +const loadHeight = () => { + return globalStore.openMenuTabs ? '405px' : '375px'; +}; + const dialogContainerLogRef = ref(); const jumpToConf = async () => { activeName.value = 'conf'; diff --git a/frontend/src/views/database/redis/index.vue b/frontend/src/views/database/redis/index.vue index 845a2b267..9dd86e5fd 100644 --- a/frontend/src/views/database/redis/index.vue +++ b/frontend/src/views/database/redis/index.vue @@ -21,7 +21,7 @@ @@ -121,13 +121,19 @@
- + @@ -236,6 +242,16 @@ const cleanTimer = () => { } }; +const loadHeight = () => { + return globalStore.openMenuTabs ? '269px' : '229px'; +}; +const loadEmptyHeight = () => { + return globalStore.openMenuTabs ? '240px' : '200px'; +}; +const loadFullScreenHeight = () => { + return globalStore.openMenuTabs ? '66px' : '90px'; +}; + const handleTabsRemove = (targetName: string, action: 'remove' | 'add') => { if (action !== 'remove') { return; @@ -436,7 +452,6 @@ onMounted(() => { border: none; position: absolute; right: 50px; - top: 90px; font-weight: 600; font-size: 14px; }