From c7c0266225b1fde08e5743ae1e966b789910127b Mon Sep 17 00:00:00 2001 From: hlinx <327159425@qq.com> Date: Wed, 11 Sep 2024 20:25:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E4=B8=B4=E6=97=B6=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9=E5=AE=9E=E4=BE=8B=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=97=B6=E5=8F=82=E6=95=B0=E8=BF=87=E6=BB=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=20#6872=20#=20Reviewed,=20transaction=20id:=2018170?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/instance-selector/Index.vue | 2 +- .../{sql-server => sqlserver}/Index.vue | 1 - .../{sql-server => sqlserver}/table/Index.vue | 4 --- .../table/useTableData.ts | 0 .../{sql-server => sqlserver}/useTopoData.ts | 0 .../components/form-item/InstanceList.vue | 28 +++++++++++++------ 6 files changed, 20 insertions(+), 15 deletions(-) rename dbm-ui/frontend/src/components/instance-selector/components/{sql-server => sqlserver}/Index.vue (99%) rename dbm-ui/frontend/src/components/instance-selector/components/{sql-server => sqlserver}/table/Index.vue (99%) rename dbm-ui/frontend/src/components/instance-selector/components/{sql-server => sqlserver}/table/useTableData.ts (100%) rename dbm-ui/frontend/src/components/instance-selector/components/{sql-server => sqlserver}/useTopoData.ts (100%) diff --git a/dbm-ui/frontend/src/components/instance-selector/Index.vue b/dbm-ui/frontend/src/components/instance-selector/Index.vue index 8d6f703137..4add7352cc 100644 --- a/dbm-ui/frontend/src/components/instance-selector/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/Index.vue @@ -214,7 +214,7 @@ import MysqlContent from './components/mysql/Index.vue'; import RedisContent from './components/redis/Index.vue'; import RenderRedisHost from './components/redis-host/Index.vue'; - import SqlServerContent from './components/sql-server/Index.vue'; + import SqlServerContent from './components/sqlserver/Index.vue'; import TendbClusterContent from './components/tendb-cluster/Index.vue'; import TendbClusterHostContent from './components/tendb-cluster-host/Index.vue'; diff --git a/dbm-ui/frontend/src/components/instance-selector/components/sql-server/Index.vue b/dbm-ui/frontend/src/components/instance-selector/components/sqlserver/Index.vue similarity index 99% rename from dbm-ui/frontend/src/components/instance-selector/components/sql-server/Index.vue rename to dbm-ui/frontend/src/components/instance-selector/components/sqlserver/Index.vue index f0ade1e6bc..7a8312f59b 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/sql-server/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/components/sqlserver/Index.vue @@ -158,7 +158,6 @@ }, ) => { selectClusterId.value = node.obj === 'cluster' ? node.payload.id : 0; - console.log('selectClusterId.value = ', selectClusterId.value); const rawNode = treeRef.value.getData().data.find((item: { id: number }) => item.id === node.id); if (!isOpen && !isSelected) { treeRef.value.setNodeOpened(rawNode, true); diff --git a/dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/Index.vue b/dbm-ui/frontend/src/components/instance-selector/components/sqlserver/table/Index.vue similarity index 99% rename from dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/Index.vue rename to dbm-ui/frontend/src/components/instance-selector/components/sqlserver/table/Index.vue index b441f101bb..7b8d07363d 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/components/sqlserver/table/Index.vue @@ -305,11 +305,7 @@ }, { immediate: true, deep: true }); watch(() => props.clusterId, () => { - setTimeout(() => { fetchResources(); - }) - }, { - immediate: true, }); const triggerChange = () => { diff --git a/dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/useTableData.ts b/dbm-ui/frontend/src/components/instance-selector/components/sqlserver/table/useTableData.ts similarity index 100% rename from dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/useTableData.ts rename to dbm-ui/frontend/src/components/instance-selector/components/sqlserver/table/useTableData.ts diff --git a/dbm-ui/frontend/src/components/instance-selector/components/sql-server/useTopoData.ts b/dbm-ui/frontend/src/components/instance-selector/components/sqlserver/useTopoData.ts similarity index 100% rename from dbm-ui/frontend/src/components/instance-selector/components/sql-server/useTopoData.ts rename to dbm-ui/frontend/src/components/instance-selector/components/sqlserver/useTopoData.ts diff --git a/dbm-ui/frontend/src/views/temporary-paassword-modify/index/components/form-item/InstanceList.vue b/dbm-ui/frontend/src/views/temporary-paassword-modify/index/components/form-item/InstanceList.vue index 21239d596e..7de0f32dc4 100644 --- a/dbm-ui/frontend/src/views/temporary-paassword-modify/index/components/form-item/InstanceList.vue +++ b/dbm-ui/frontend/src/views/temporary-paassword-modify/index/components/form-item/InstanceList.vue @@ -49,6 +49,8 @@ import SqlServerHaInstanceModel from '@services/model/sqlserver/sqlserver-ha-instance'; import SqlServerSingleInstanceModel from '@services/model/sqlserver/sqlserver-single-instance'; import { queryAdminPassword } from '@services/source/permission'; + import { getSpiderInstanceList } from '@services/source/spider'; + import { getTendbhaInstanceList } from '@services/source/tendbha'; import { clusterTypeInfos,ClusterTypes } from '@common/const'; @@ -63,31 +65,39 @@ `${instance.bk_cloud_id}:${instance.ip}:${instance.port}`; const tabListConfig = { - [ClusterTypes.TENDBCLUSTER]: [ + [ClusterTypes.TENDBHA]: [ { - name: 'TendbCluster', + id: 'tendbha', + name: t('Mysql 主从'), tableConfig: { + getTableList: (params: ServiceParameters) => getTendbhaInstanceList({ + ...params, + role_exclude: 'proxy', + }), firsrColumn: { - label: 'instance_address', + label: t('实例'), field: 'instance_address', role: '', }, }, - }, + } ], - [ClusterTypes.TENDBHA]: [ + [ClusterTypes.TENDBCLUSTER]: [ { - id: 'tendbha', - name: t('Mysql 主从'), + name: 'TendbCluster', tableConfig: { + getTableList: (params: ServiceParameters) => getSpiderInstanceList({ + ...params, + spider_ctl: true, + }), firsrColumn: { label: t('实例'), field: 'instance_address', role: '', }, }, - } - ] + }, + ], } as unknown as Record;