From 50158b5305226ec9049fe96a1ed8012e4406b0ce Mon Sep 17 00:00:00 2001 From: chenwenchang <479999519@qq.com> Date: Tue, 3 Dec 2024 16:03:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E5=8D=95=E6=8D=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=BF=AD=E4=BB=A3=5F1203=20#7190=20#=20Reviewed,=20tr?= =?UTF-8?q?ansaction=20id:=2025675?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/src/locales/zh-cn.json | 1 + .../model/ticket/details/redis/index.ts | 2 - .../model/ticket/details/redis/scaleDown.ts | 3 - .../model/ticket/details/redis/scaleUp.ts | 3 - .../model/ticket/details/redis/scaleUpdown.ts | 5 + .../page1/components/RenderSwitchMode.vue | 2 +- .../pages/page1/components/Row.vue | 21 +- .../cluster-type-update/pages/page1/Index.vue | 2 + .../common/cluster-deploy-plan/Index.vue | 2 +- .../redis/ClusterShardNumUpdate.vue | 195 +++++--------- .../com-factory/redis/ClusterTypeUpdate.vue | 237 ++++++------------ .../com-factory/redis/ScaleUpdown.vue | 147 +++++------ .../redis/ClusterTypeUpdate.vue | 191 -------------- 13 files changed, 232 insertions(+), 579 deletions(-) delete mode 100644 dbm-ui/frontend/src/services/model/ticket/details/redis/scaleDown.ts delete mode 100644 dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUp.ts delete mode 100644 dbm-ui/frontend/src/views/tickets/common/components/demand-factory/redis/ClusterTypeUpdate.vue diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index db35e16b74..2cedc5beae 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -3745,5 +3745,6 @@ "强制实例下架:": "强制实例下架:", "Excel文件:": "Excel文件:", "不一致时间范围:": "不一致时间范围:", + "变更信息:": "变更信息:", "这行勿动!新增翻译请在上一行添加!": "" } diff --git a/dbm-ui/frontend/src/services/model/ticket/details/redis/index.ts b/dbm-ui/frontend/src/services/model/ticket/details/redis/index.ts index 7a303ee825..15171e5ccf 100644 --- a/dbm-ui/frontend/src/services/model/ticket/details/redis/index.ts +++ b/dbm-ui/frontend/src/services/model/ticket/details/redis/index.ts @@ -28,8 +28,6 @@ export * from './proxyOpen'; export * from './proxyScaleDown'; export * from './proxyScaleUp'; export * from './purge'; -export * from './scaleDown'; -export * from './scaleUp'; export * from './scaleUpdown'; export * from './slotsMigrate'; export * from './versionUpdateOnline'; diff --git a/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleDown.ts b/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleDown.ts deleted file mode 100644 index 72d8f5decf..0000000000 --- a/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleDown.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DetailBase } from '../common'; - -export interface ScaleDown extends DetailBase {} diff --git a/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUp.ts b/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUp.ts deleted file mode 100644 index e9362b8bb3..0000000000 --- a/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUp.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DetailBase } from '../common'; - -export interface ScaleUp extends DetailBase {} diff --git a/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUpdown.ts b/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUpdown.ts index 06defb9f76..f8ad5e985b 100644 --- a/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUpdown.ts +++ b/dbm-ui/frontend/src/services/model/ticket/details/redis/scaleUpdown.ts @@ -1,3 +1,4 @@ +import type RedisModel from '@services/model/redis/redis'; import type { OnlineSwitchType } from '@services/types'; import type { DetailBase, DetailClusters, DetailSpecs } from '../common'; @@ -22,6 +23,10 @@ export interface ScaleUpdown extends DetailBase { affinity: 'CROS_SUBZONE'; }; }; + display_info: Pick< + RedisModel, + 'cluster_stats' | 'cluster_spec' | 'cluster_shard_num' | 'cluster_capacity' | 'machine_pair_cnt' + >; }[]; specs: DetailSpecs; } diff --git a/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/RenderSwitchMode.vue b/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/RenderSwitchMode.vue index e46820bf03..6b538b5d6b 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/RenderSwitchMode.vue +++ b/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/RenderSwitchMode.vue @@ -41,7 +41,7 @@ } interface Exposes { - getValue: () => Promise; + getValue: () => Promise; } const props = withDefaults(defineProps(), { diff --git a/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/Row.vue b/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/Row.vue index 31c188be06..c80ec87f28 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/Row.vue +++ b/dbm-ui/frontend/src/views/db-manage/redis/capacity-change/pages/page1/components/Row.vue @@ -123,6 +123,10 @@ affinity: AffinityType; // 暂时固定 'CROS_SUBZONE', }; }; + display_info: Pick< + RedisModel, + 'cluster_stats' | 'cluster_spec' | 'cluster_shard_num' | 'cluster_capacity' | 'machine_pair_cnt' + >; } // 创建表格数据 @@ -166,6 +170,13 @@ const targetCapacityRef = ref>(); const switchModeRef = ref>(); const localTargetVersion = ref(''); + const displayInfo = ref({ + cluster_stats: {}, + cluster_spec: {}, + cluster_shard_num: 0, + cluster_capacity: 0, + machine_pair_cnt: 0, + } as InfoItem['display_info']); const handleTargetVersionChange = (value: string) => { localTargetVersion.value = value; @@ -173,6 +184,13 @@ const handleInputFinish = (value: RedisModel) => { emits('clusterInputFinish', value); + displayInfo.value = { + cluster_stats: value.cluster_stats, + cluster_spec: value.cluster_spec, + cluster_shard_num: value.cluster_shard_num, + cluster_capacity: value.cluster_capacity, + machine_pair_cnt: value.machine_pair_cnt, + }; }; const handleAppend = () => { @@ -185,7 +203,7 @@ defineExpose({ async getValue() { - await clusterRef.value!.getValue(true); + await clusterRef.value!.getValue(); return Promise.all([ versionRef.value!.getValue(), switchModeRef.value!.getValue(), @@ -198,6 +216,7 @@ bk_cloud_id: props.data.bkCloudId, online_switch_type: switchMode, ...targetCapacity, + display_info: displayInfo.value, }; }); }, diff --git a/dbm-ui/frontend/src/views/db-manage/redis/cluster-type-update/pages/page1/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/cluster-type-update/pages/page1/Index.vue index ba4d440c3b..159d91bbe7 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/cluster-type-update/pages/page1/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/redis/cluster-type-update/pages/page1/Index.vue @@ -279,6 +279,8 @@ const newList = list.reduce((result, item) => { const domain = item.master_domain; if (!domainMemo[domain]) { + console.log(item, 'item'); + const row = generateTableRow(item); result.push(row); domainMemo[domain] = true; diff --git a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-deploy-plan/Index.vue b/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-deploy-plan/Index.vue index 6aa9c88d78..0a01188723 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-deploy-plan/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-deploy-plan/Index.vue @@ -485,7 +485,7 @@ machine_pair: specInfo.count }) Object.assign(capacityInfo, { - current: specInfo.totalCapcity, + current: props.data.capacity.total, future: specInfo.totalCapcity }) } diff --git a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterShardNumUpdate.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterShardNumUpdate.vue index 57063c38fc..cfd2e84372 100644 --- a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterShardNumUpdate.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterShardNumUpdate.vue @@ -12,162 +12,99 @@ --> - diff --git a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterTypeUpdate.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterTypeUpdate.vue index 2d51ca6c13..a1b71d38e6 100644 --- a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterTypeUpdate.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ClusterTypeUpdate.vue @@ -12,194 +12,107 @@ --> - diff --git a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ScaleUpdown.vue b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ScaleUpdown.vue index 616330ce03..36488d1b01 100644 --- a/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ScaleUpdown.vue +++ b/dbm-ui/frontend/src/views/ticket-center/common/ticket-detail/components/task-info/com-factory/redis/ScaleUpdown.vue @@ -12,57 +12,56 @@ --> -