From b6b411b43e2fde3605dffce0b69147791b9a376b Mon Sep 17 00:00:00 2001 From: chenwenchang <479999519@qq.com> Date: Wed, 13 Nov 2024 18:19:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20webconsole=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=BB=84=E4=BB=B6=E9=80=BB=E8=BE=91=E4=BC=98?= =?UTF-8?q?=E5=8C=96=20#7764=20#=20Reviewed,=20transaction=20id:=2024001?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db-manage/common/webconsole/Index.vue | 26 +- .../webconsole/components/ClusterTabs.vue | 2 +- .../webconsole/components/RawSwitcher.vue | 10 +- .../ConsoleInput.vue} | 242 +++++++----------- .../components/RenderRedisMessage.vue | 66 ----- .../components/console-panel/mysql/Index.vue | 43 ++++ .../components/RenderMessage.vue} | 12 +- .../components/console-panel/redis/Index.vue | 49 ++++ .../redis/components/RenderMessage.vue | 25 ++ 9 files changed, 228 insertions(+), 247 deletions(-) rename dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/{Index.vue => components/ConsoleInput.vue} (56%) delete mode 100644 dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/RenderRedisMessage.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/mysql/Index.vue rename dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/{components/RenderMysqlMessage.vue => mysql/components/RenderMessage.vue} (86%) create mode 100644 dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/redis/Index.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/redis/components/RenderMessage.vue diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/Index.vue index 778d2143f6..44e823babb 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/webconsole/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/webconsole/Index.vue @@ -11,8 +11,7 @@ @remove-tab="handleClickClearScreen" /> + v-model="isRaw" />
- @@ -59,13 +58,12 @@ import screenfull from 'screenfull'; import { useI18n } from 'vue-i18n'; - import { queryAllTypeCluster } from '@services/source/dbbase'; - import { DBTypes } from '@common/const'; import ClearScreen from './components/ClearScreen.vue'; - import ClusterTabs from './components/ClusterTabs.vue'; - import ConsolePanel from './components/console-panel/Index.vue'; + import ClusterTabs, { type ClusterItem } from './components/ClusterTabs.vue'; + import MysqlConsolePanel from './components/console-panel/mysql/Index.vue'; + import RedisConsolePanel from './components/console-panel/redis/Index.vue'; import ExportData from './components/ExportData.vue'; import FontSetting from './components/FontSetting.vue'; import FullScreen from './components/FullScreen.vue'; @@ -76,17 +74,21 @@ dbType?: DBTypes; } - type ClusterItem = ServiceReturnType[number]; - const props = withDefaults(defineProps(), { dbType: DBTypes.MYSQL, }); const { t } = useI18n(); + const consolePanelMap = { + [DBTypes.MYSQL]: MysqlConsolePanel, + [DBTypes.TENDBCLUSTER]: MysqlConsolePanel, + [DBTypes.REDIS]: RedisConsolePanel, + } as Record; + const rootRef = ref(); const clusterTabsRef = ref(); - const consolePanelRef = ref>(); + const consolePanelRef = ref>(); const clusterInfo = ref(); const currentFontConfig = ref({ fontSize: '12px', diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/ClusterTabs.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/ClusterTabs.vue index cf5a9dbfbb..1dca2bce9f 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/ClusterTabs.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/ClusterTabs.vue @@ -74,7 +74,7 @@ import { messageWarn } from '@utils'; - type ClusterItem = ServiceReturnType[number]; + export type ClusterItem = ServiceReturnType[number]; interface Props { dbType: DBTypes; diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/RawSwitcher.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/RawSwitcher.vue index c169ef845a..4251283cdd 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/RawSwitcher.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/RawSwitcher.vue @@ -17,14 +17,6 @@ diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/ConsoleInput.vue similarity index 56% rename from dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/Index.vue rename to dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/ConsoleInput.vue index 96c9c59a79..a3c07a9cf0 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/ConsoleInput.vue @@ -13,9 +13,7 @@ {{ item.message }}
@@ -36,36 +34,54 @@ + diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/RenderRedisMessage.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/RenderRedisMessage.vue deleted file mode 100644 index 625451b6eb..0000000000 --- a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/RenderRedisMessage.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - - - diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/mysql/Index.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/mysql/Index.vue new file mode 100644 index 0000000000..302aa44b1b --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/mysql/Index.vue @@ -0,0 +1,43 @@ + + + diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/RenderMysqlMessage.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/mysql/components/RenderMessage.vue similarity index 86% rename from dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/RenderMysqlMessage.vue rename to dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/mysql/components/RenderMessage.vue index 054cbf1128..b639eb2f71 100644 --- a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/components/RenderMysqlMessage.vue +++ b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/mysql/components/RenderMessage.vue @@ -24,21 +24,11 @@ - - diff --git a/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/redis/components/RenderMessage.vue b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/redis/components/RenderMessage.vue new file mode 100644 index 0000000000..10b03e8497 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/common/webconsole/components/console-panel/redis/components/RenderMessage.vue @@ -0,0 +1,25 @@ + + + + +