From 4923e73540dead59bf821d2eba505881e191cc0b Mon Sep 17 00:00:00 2001 From: chenwenchang <479999519@qq.com> Date: Mon, 30 Dec 2024 16:36:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E5=B7=A5=E5=85=B7=E7=AE=B1?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=B5=84=E6=BA=90=E6=B1=A0=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=5Fredis=E6=95=B4=E6=9C=BA=E6=9B=BF=E6=8D=A2?= =?UTF-8?q?=20#8076=20#=20Reviewed,=20transaction=20id:=2028115?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../columns/spec-display/Panel.vue | 6 +- .../redis/REDIS_CLUSTER_CUTOFF/Create.vue | 354 ++++++++++++ .../redis/REDIS_CLUSTER_CUTOFF/Index.vue | 32 ++ .../components/HostColumn.vue | 149 +++++ .../components/SpecColumn.vue | 64 +++ .../components/instance-selector/Index.vue | 172 ++++++ .../instance-selector/common/tableSettings.ts | 67 +++ .../instance-selector/common/utils.ts | 19 + .../instance-selector/components/PanelTab.vue | 82 +++ .../components/RenderManualHost.vue | 249 +++++++++ .../components/RenderManualInput.vue | 333 ++++++++++++ .../components/RenderRedis.vue | 306 +++++++++++ .../components/RenderRedisHost.vue | 509 ++++++++++++++++++ .../preview-result/CollapseMini.vue | 96 ++++ .../components/preview-result/Index.vue | 212 ++++++++ .../src/views/db-manage/redis/routes.ts | 9 +- .../src/views/db-manage/redis/toolbox-menu.ts | 2 +- 17 files changed, 2649 insertions(+), 12 deletions(-) create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Create.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Index.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/HostColumn.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/SpecColumn.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/Index.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/tableSettings.ts create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/utils.ts create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/PanelTab.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualHost.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualInput.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedis.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedisHost.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/CollapseMini.vue create mode 100644 dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/Index.vue diff --git a/dbm-ui/frontend/src/components/render-table/columns/spec-display/Panel.vue b/dbm-ui/frontend/src/components/render-table/columns/spec-display/Panel.vue index ad0d01952a..83e4ccd08f 100644 --- a/dbm-ui/frontend/src/components/render-table/columns/spec-display/Panel.vue +++ b/dbm-ui/frontend/src/components/render-table/columns/spec-display/Panel.vue @@ -58,13 +58,13 @@
- {{ data.storage_spec[0].mount_point }} + {{ data.storage_spec[0]?.mount_point || '--' }}
- {{ data.storage_spec[0].size }} + {{ data.storage_spec[0]?.size || '--' }}
- {{ data.storage_spec[0].type }} + {{ data.storage_spec[0]?.type || '--' }}
diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Create.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Create.vue new file mode 100644 index 0000000000..fe1142da07 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Create.vue @@ -0,0 +1,354 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Index.vue new file mode 100644 index 0000000000..7d5a04e740 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/Index.vue @@ -0,0 +1,32 @@ + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/HostColumn.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/HostColumn.vue new file mode 100644 index 0000000000..de5b004143 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/HostColumn.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/SpecColumn.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/SpecColumn.vue new file mode 100644 index 0000000000..2507e2a63f --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/SpecColumn.vue @@ -0,0 +1,64 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/Index.vue new file mode 100644 index 0000000000..48c2897d87 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/Index.vue @@ -0,0 +1,172 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/tableSettings.ts b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/tableSettings.ts new file mode 100644 index 0000000000..2f62f989d5 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/tableSettings.ts @@ -0,0 +1,67 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + * the specific language governing permissions and limitations under the License. + */ + +import { t } from '@locales/index'; + +const getSettings = (role?: string) => ({ + fields: [ + { + label: role ? role.charAt(0).toUpperCase() + role.slice(1) : t('实例'), + field: 'instance_address', + disabled: true, + }, + { + label: t('角色'), + field: 'role', + }, + { + label: t('实例状态'), + field: 'status', + }, + { + label: t('管控区域'), + field: 'cloud_area', + }, + { + label: t('Agent状态'), + field: 'alive', + }, + { + label: t('主机名称'), + field: 'host_name', + }, + { + label: t('OS名称'), + field: 'os_name', + }, + { + label: t('所属云厂商'), + field: 'cloud_vendor', + }, + { + label: t('OS类型'), + field: 'os_type', + }, + { + label: t('主机ID'), + field: 'host_id', + }, + { + label: 'Agent ID', + field: 'agent_id', + }, + ], + checked: ['instance_address', 'role', 'cloud_area', 'alive', 'host_name'], +}); + +export default getSettings; diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/utils.ts b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/utils.ts new file mode 100644 index 0000000000..76f5ed7416 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/common/utils.ts @@ -0,0 +1,19 @@ +/* + * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. + * + * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. + * You may obtain a copy of the License at https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for + * the specific language governing permissions and limitations under the License. + */ + +import { t } from '@locales/index'; + +export const textMap = { + idleHosts: t('待替换的主机'), + manualInput: t('手动输入'), +}; diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/PanelTab.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/PanelTab.vue new file mode 100644 index 0000000000..962a3426b4 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/PanelTab.vue @@ -0,0 +1,82 @@ + + + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualHost.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualHost.vue new file mode 100644 index 0000000000..92e2636841 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualHost.vue @@ -0,0 +1,249 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualInput.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualInput.vue new file mode 100644 index 0000000000..85bc75f55a --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderManualInput.vue @@ -0,0 +1,333 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedis.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedis.vue new file mode 100644 index 0000000000..ccb78f5e60 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedis.vue @@ -0,0 +1,306 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedisHost.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedisHost.vue new file mode 100644 index 0000000000..e2c4d1d11e --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/RenderRedisHost.vue @@ -0,0 +1,509 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/CollapseMini.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/CollapseMini.vue new file mode 100644 index 0000000000..a871747981 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/CollapseMini.vue @@ -0,0 +1,96 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/Index.vue new file mode 100644 index 0000000000..2857932575 --- /dev/null +++ b/dbm-ui/frontend/src/views/db-manage/redis/REDIS_CLUSTER_CUTOFF/components/instance-selector/components/preview-result/Index.vue @@ -0,0 +1,212 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/db-manage/redis/routes.ts b/dbm-ui/frontend/src/views/db-manage/redis/routes.ts index e9138064ec..84a2d4167b 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/routes.ts +++ b/dbm-ui/frontend/src/views/db-manage/redis/routes.ts @@ -67,14 +67,7 @@ const redisMasterFailoverRoute = { component: () => import('@views/db-manage/redis/master-failover/Index.vue'), }; -const redisDBReplaceRoute = { - name: 'RedisDBReplace', - path: 'db-replace/:page?', - meta: { - navName: t('整机替换'), - }, - component: () => import('@views/db-manage/redis/db-replace/Index.vue'), -}; +const redisDBReplaceRoute = createRouteItem(TicketTypes.REDIS_CLUSTER_CUTOFF, t('整机替换')); const redisClusterShardUpdateRoute = { name: 'RedisClusterShardUpdate', diff --git a/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts b/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts index 40860d075f..a1d04fa439 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts +++ b/dbm-ui/frontend/src/views/db-manage/redis/toolbox-menu.ts @@ -54,7 +54,7 @@ export default [ }, { name: t('整机替换'), - id: 'RedisDBReplace', + id: TicketTypes.REDIS_CLUSTER_CUTOFF, parentId: 'common-manage', dbConsoleValue: 'redis.toolbox.dbReplace', },