From 3a46afdab0c04c77303c7ae917622deb7283fa74 Mon Sep 17 00:00:00 2001 From: 3octaves <873551943@qq.com> Date: Mon, 2 Dec 2024 11:24:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=BF=AE=E5=A4=8Dmysql?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E5=8D=87=E7=BA=A7=E6=96=B0=E5=8F=AA=E8=AF=BB?= =?UTF-8?q?=E4=B8=BB=E6=9C=BA=E6=8F=90=E5=8D=95=E6=97=B6=E7=9A=84=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F=E9=97=AE=E9=A2=98=20#8321?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RenderNewReadonlySlaveHost.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderNewReadonlySlaveHost.vue b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderNewReadonlySlaveHost.vue index f8d7e832ff..cafd75fb67 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderNewReadonlySlaveHost.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/version-upgrade/pages/page1/components/ha-storage-layer-remote/RenderNewReadonlySlaveHost.vue @@ -124,10 +124,16 @@ // IP 有效 singleHostSelectMemo[instanceKey] = {}; slaveHostMemo = []; - data.hosts_topo_info.forEach((item) => { - if (ipList.includes(item.ip) && item.bk_cloud_id === props.cloudId) { - slaveHostMemo.push(item); - singleHostSelectMemo[instanceKey][genHostKey(item)] = true; + // 新只读主机和旧只读主机是对应关系,需要按输入的顺序提单 + const topoHostMap = data.hosts_topo_info.reduce>( + (prev, item) => Object.assign({}, prev, { [item.ip]: item }), + {}, + ); + ipList.forEach((inputIpItem) => { + const topoHostItem = topoHostMap[inputIpItem]; + if (topoHostItem) { + slaveHostMemo.push(topoHostItem); + singleHostSelectMemo[instanceKey][genHostKey(topoHostItem)] = true; } }); return true;