From e1c8fa740b3ebb55d90ca0407d518abc0f111cad Mon Sep 17 00:00:00 2001 From: 3octaves <873551943@qq.com> Date: Thu, 16 Jan 2025 17:55:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=BF=AE=E5=A4=8D=E6=89=A9?= =?UTF-8?q?=E5=AE=B9=E6=8E=A5=E5=85=A5=E5=B1=82=E5=8D=95=E6=8D=AE=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8Dproxy=E7=9A=84?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E8=A7=84=E6=A0=BC=EF=BC=8C=E5=B9=B6=E4=B8=94?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=B8=8B=E6=8B=89=E6=A1=86=E9=87=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E6=98=AF=E5=90=8E=E7=AB=AF=E8=A7=84=E6=A0=BC?= =?UTF-8?q?=E4=B8=8D=E6=98=AFproxy=E7=9A=84=E6=9C=BA=E5=99=A8=E8=A7=84?= =?UTF-8?q?=E6=A0=BC=20#9108?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/page1/components/Row.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/dbm-ui/frontend/src/views/db-manage/redis/proxy-scale-up/pages/page1/components/Row.vue b/dbm-ui/frontend/src/views/db-manage/redis/proxy-scale-up/pages/page1/components/Row.vue index 2cf02ee644..86674af357 100644 --- a/dbm-ui/frontend/src/views/db-manage/redis/proxy-scale-up/pages/page1/components/Row.vue +++ b/dbm-ui/frontend/src/views/db-manage/redis/proxy-scale-up/pages/page1/components/Row.vue @@ -65,7 +65,6 @@ import OperateColumn from '@components/render-table/columns/operate-column/index.vue'; import RenderText from '@components/render-table/columns/text-plain/index.vue'; - import { specClusterMachineMap } from '@views/db-manage/redis/common/const'; import RenderTargetCluster from '@views/db-manage/redis/common/edit-field/ClusterName.vue'; import { random } from '@utils'; @@ -144,19 +143,28 @@ // 查询集群对应的规格列表 const querySpecList = async (item: RedisModel) => { - const clusterType = item.cluster_type; - const specId = item.cluster_spec.spec_id; - const specCount = item.proxy.length; + const specCountMap = item.proxy.reduce>((prevMap, proxyItem) => { + if (prevMap[proxyItem.spec_config.id]) { + return Object.assign({}, prevMap, { + [proxyItem.spec_config.id]: prevMap[proxyItem.spec_config.id] + 1, + }); + } + return Object.assign({}, prevMap, { + [proxyItem.spec_config.id]: 1, + }); + }, {}); const ret = await getResourceSpecList({ spec_cluster_type: 'redis', - spec_machine_type: specClusterMachineMap[clusterType], + spec_machine_type: 'proxy', limit: -1, offset: 0, }); const retArr = ret.results; const arr = retArr.map((item) => ({ value: item.spec_id, - label: item.spec_id === specId ? `${item.spec_name} ${t('((n))台', { n: specCount })}` : item.spec_name, + label: specCountMap[item.spec_id] + ? `${item.spec_name} ${t('((n))台', { n: specCountMap[item.spec_id] })}` + : item.spec_name, specData: { name: item.spec_name, cpu: item.cpu,