From d23cb2f93e460c79be48184a901f855952c4a321 Mon Sep 17 00:00:00 2001 From: Austin <1344583166@qq.com> Date: Tue, 3 Sep 2024 10:22:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20po=E7=8E=AF=E5=A2=83sql?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=9C=89=E5=85=B3=E7=9A=84=E9=9D=9E=E6=B3=95?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=96=B0=E5=A2=9E=E5=BC=80=E5=85=B3=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=20#6625?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/src/App.vue | 7 +- .../views/mysql/common/hooks/useTaskCount.ts | 28 ++-- .../mysql/ha-cluster-list/components/List.vue | 2 +- .../redis/list/components/list/Index.vue | 26 ++-- .../toolbox-side/components/MenuGroup.vue | 5 - .../toolbox-side/components/TaskCount.vue | 133 ------------------ .../list/components/list/Index.vue | 26 ++-- 7 files changed, 44 insertions(+), 183 deletions(-) delete mode 100644 dbm-ui/frontend/src/views/redis/toolbox/components/toolbox-side/components/TaskCount.vue diff --git a/dbm-ui/frontend/src/App.vue b/dbm-ui/frontend/src/App.vue index d5cbda6495..463954d91c 100644 --- a/dbm-ui/frontend/src/App.vue +++ b/dbm-ui/frontend/src/App.vue @@ -64,7 +64,7 @@ import { useSQLTaskNotify } from '@hooks'; - import { useFunController, useUserProfile } from '@stores'; + import { useUserProfile } from '@stores'; import DbRouterView from '@components/db-router-view/Index.vue'; import LocaleSwitch from '@components/locale-switch/Index.vue'; @@ -72,6 +72,8 @@ import SystemSearch from '@components/system-search/Index.vue'; import SystemVersionLog from '@components/system-version-log/Index.vue'; + import { checkDbConsole } from '@utils'; + import NoticeComponent from '@blueking/notice-component'; import Layout from './layout/Index.vue'; @@ -81,7 +83,6 @@ const userProfileStore = useUserProfile(); userProfileStore.fetchProfile(); const { t, locale } = useI18n(); - const { funControllerData } = useFunController(); const documentTitles: Record = { en: 'DBM | Tencent BlueKing', @@ -123,7 +124,7 @@ }; onMounted(() => { - if (funControllerData.getFlatData('mysql').toolbox) { + if (checkDbConsole('mysql.toolbox.sqlExecute') || checkDbConsole('tendbCluster.toolbox.sqlExecute')) { useSQLTaskNotify(); } }); diff --git a/dbm-ui/frontend/src/views/mysql/common/hooks/useTaskCount.ts b/dbm-ui/frontend/src/views/mysql/common/hooks/useTaskCount.ts index 2a833edcf8..daf8d409ad 100644 --- a/dbm-ui/frontend/src/views/mysql/common/hooks/useTaskCount.ts +++ b/dbm-ui/frontend/src/views/mysql/common/hooks/useTaskCount.ts @@ -19,6 +19,8 @@ import { deleteUserSemanticTasks, getUserSemanticTasks } from '@services/source/ import { useSQLTaskCount } from '@stores'; +import { checkDbConsole } from '@utils'; + import { useTimeoutPoll } from '@vueuse/core'; export const useTaskCount = (clusterType: string) => { @@ -60,19 +62,21 @@ export const useTaskCount = (clusterType: string) => { }; const fetchData = () => { - getUserSemanticTasks({ - cluster_type: clusterType, - }).then((data) => { - if (taskCountStore.isPolling === false) { - resume(); - taskCountStore.isPolling = true; - } - - taskCountStore.taskList = data; - nextTick(() => { - initPopover(); + if (checkDbConsole('mysql.toolbox.sqlExecute') || checkDbConsole('tendbCluster.toolbox.sqlExecute')) { + getUserSemanticTasks({ + cluster_type: clusterType, + }).then((data) => { + if (taskCountStore.isPolling === false) { + resume(); + taskCountStore.isPolling = true; + } + + taskCountStore.taskList = data; + nextTick(() => { + initPopover(); + }); }); - }); + } }; fetchData(); diff --git a/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/List.vue b/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/List.vue index eddb25558b..44d3e29262 100644 --- a/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/List.vue +++ b/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/List.vue @@ -765,7 +765,7 @@ action-id="mysql_webconsole" resource={data.id} permission={data.permission.mysql_webconsole} - disabled={data.operationDisabled} + disabled={data.isOffline} text theme="primary" class="mr-8" diff --git a/dbm-ui/frontend/src/views/redis/list/components/list/Index.vue b/dbm-ui/frontend/src/views/redis/list/components/list/Index.vue index 842fa8afb6..f55fd3a098 100644 --- a/dbm-ui/frontend/src/views/redis/list/components/list/Index.vue +++ b/dbm-ui/frontend/src/views/redis/list/components/list/Index.vue @@ -854,21 +854,17 @@ render: ({ data }: ColumnRenderData) => { const getOperations = (theme = 'primary') => { const baseOperations = [ - - handleGoWebconsole(data.id)}> - Webconsole - - , + handleGoWebconsole(data.id)}> + Webconsole + , {{ item.name }} - - - - - - diff --git a/dbm-ui/frontend/src/views/spider-manage/list/components/list/Index.vue b/dbm-ui/frontend/src/views/spider-manage/list/components/list/Index.vue index 91fc01f168..32af09a72d 100644 --- a/dbm-ui/frontend/src/views/spider-manage/list/components/list/Index.vue +++ b/dbm-ui/frontend/src/views/spider-manage/list/components/list/Index.vue @@ -903,20 +903,18 @@ onClick={() => handleShowAuthorize([data])}> { t('授权') } , - - handleGoWebconsole(data.id)}> - Webconsole - - , + handleGoWebconsole(data.id)}> + Webconsole + ,