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