From ee0e17a4966bd5e61033de35a5cdeb3b704082be Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:16:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=88=87=E6=8D=A2=E7=89=88=E6=9C=AC=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98=20(#7111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/constant/errs.go | 1 + frontend/src/components/app-status/index.vue | 8 ++++---- frontend/src/views/database/mysql/index.vue | 4 +--- frontend/src/views/database/postgresql/index.vue | 4 +--- frontend/src/views/database/redis/index.vue | 4 +--- 5 files changed, 8 insertions(+), 13 deletions(-) diff --git a/backend/constant/errs.go b/backend/constant/errs.go index c1b3dfff5..59ba65c8b 100644 --- a/backend/constant/errs.go +++ b/backend/constant/errs.go @@ -47,6 +47,7 @@ var ( ErrXpackNotFound = "ErrXpackNotFound" ErrXpackNotActive = "ErrXpackNotActive" ErrXpackLost = "ErrXpackLost" + ErrXpackTimeout = "ErrXpackTimeout" ErrXpackOutOfDate = "ErrXpackOutOfDate" ) diff --git a/frontend/src/components/app-status/index.vue b/frontend/src/components/app-status/index.vue index f14eb95b7..ae7c6bc68 100644 --- a/frontend/src/components/app-status/index.vue +++ b/frontend/src/components/app-status/index.vue @@ -159,8 +159,8 @@ const isDB = () => { return key.value === 'mysql' || key.value === 'mariadb' || key.value === 'postgresql'; }; -const onCheck = async () => { - await CheckAppInstalled(key.value, name.value) +const onCheck = async (key: any, name: any) => { + await CheckAppInstalled(key, name) .then((res) => { data.value = res.data; em('isExist', res.data); @@ -206,7 +206,7 @@ const onOperate = async (operation: string) => { .then(() => { em('update:loading', false); MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); - onCheck(); + onCheck(key.value, name.value); em('after'); }) .catch(() => { @@ -234,7 +234,7 @@ const getTitle = (key: string) => { onMounted(() => { key.value = props.appKey; name.value = props.appName; - onCheck(); + onCheck(key.value, name.value); }); defineExpose({ diff --git a/frontend/src/views/database/mysql/index.vue b/frontend/src/views/database/mysql/index.vue index 5f551e245..4c773c9a0 100644 --- a/frontend/src/views/database/mysql/index.vue +++ b/frontend/src/views/database/mysql/index.vue @@ -388,15 +388,13 @@ const onSetting = async () => { }; const changeDatabase = async () => { - if (currentDB.value.from === 'local') { - appStatusRef.value.onCheck(); - } for (const item of dbOptionsLocal.value) { if (item.database == currentDBName.value) { currentDB.value = item; appKey.value = item.type; appName.value = item.database; search(); + appStatusRef.value?.onCheck(appKey.value, appName.value); return; } } diff --git a/frontend/src/views/database/postgresql/index.vue b/frontend/src/views/database/postgresql/index.vue index eceea68b1..b2f5761bc 100644 --- a/frontend/src/views/database/postgresql/index.vue +++ b/frontend/src/views/database/postgresql/index.vue @@ -351,15 +351,13 @@ const onSetting = async () => { }; const changeDatabase = async () => { - if (currentDB.value.from === 'local') { - appStatusRef.value.onCheck(); - } for (const item of dbOptionsLocal.value) { if (item.database == currentDBName.value) { currentDB.value = item; appKey.value = item.type; appName.value = item.database; search(); + appStatusRef.value?.onCheck(appKey.value, appName.value); return; } } diff --git a/frontend/src/views/database/redis/index.vue b/frontend/src/views/database/redis/index.vue index 32b3b3d73..5c33325e4 100644 --- a/frontend/src/views/database/redis/index.vue +++ b/frontend/src/views/database/redis/index.vue @@ -223,14 +223,12 @@ const goRouter = async (target: string) => { }; const changeDatabase = async () => { - if (currentDB.value.from === 'local') { - appStatusRef.value.onCheck(); - } for (const item of dbOptionsLocal.value) { if (item.database == currentDBName.value) { currentDB.value = item; appKey.value = item.type; appName.value = item.database; + appStatusRef.value?.onCheck(appKey.value, appName.value); reOpenTerminal(); return; }