From 297781da08e8de18705e2f747c064132f3579ca2 Mon Sep 17 00:00:00 2001 From: chenwenchang <479999519@qq.com> Date: Thu, 14 Nov 2024 11:07:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E9=9B=86=E7=BE=A4=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=8C=96=20#4654=20#=20Reviewed,=20transaction=20id:?= =?UTF-8?q?=2024078?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...queryClusterTypes.ts => dbClusterTypes.ts} | 2 +- dbm-ui/frontend/src/common/const/index.ts | 2 +- dbm-ui/frontend/src/services/source/dbbase.ts | 32 +++++++++++++- dbm-ui/frontend/src/services/source/mysql.ts | 7 --- .../components/cluster-selector/Index.vue | 24 +++++----- .../components/cluster-select/Index.vue | 4 +- .../components/cluster-select/Table.vue | 6 +-- .../cluster-select/hooks/useTableData.ts | 27 +++++++----- .../components/manual-input/Index.vue | 44 ++++++++++++------- .../components/manual-input/Table.vue | 4 +- .../components/preview-result/Index.vue | 4 +- .../components/mysql/Index.vue | 11 ++--- .../webconsole/components/ClusterTabs.vue | 4 +- .../partition-manage/components/Operation.vue | 4 +- .../components/SelectClusters.vue | 4 +- 15 files changed, 108 insertions(+), 71 deletions(-) rename dbm-ui/frontend/src/common/const/{queryClusterTypes.ts => dbClusterTypes.ts} (97%) diff --git a/dbm-ui/frontend/src/common/const/queryClusterTypes.ts b/dbm-ui/frontend/src/common/const/dbClusterTypes.ts similarity index 97% rename from dbm-ui/frontend/src/common/const/queryClusterTypes.ts rename to dbm-ui/frontend/src/common/const/dbClusterTypes.ts index ea08f507c0..2d1e760df4 100644 --- a/dbm-ui/frontend/src/common/const/queryClusterTypes.ts +++ b/dbm-ui/frontend/src/common/const/dbClusterTypes.ts @@ -4,7 +4,7 @@ import { DBTypes } from './dbTypes'; /** * db类型关联集群类型集合映射关系 */ -export const queryClusterTypes = { +export const DBClusterTypes = { [DBTypes.MYSQL]: [ClusterTypes.TENDBSINGLE, ClusterTypes.TENDBHA], [DBTypes.TENDBCLUSTER]: [ClusterTypes.TENDBCLUSTER], [DBTypes.REDIS]: [ diff --git a/dbm-ui/frontend/src/common/const/index.ts b/dbm-ui/frontend/src/common/const/index.ts index e600c24e77..78405019b9 100644 --- a/dbm-ui/frontend/src/common/const/index.ts +++ b/dbm-ui/frontend/src/common/const/index.ts @@ -4,6 +4,7 @@ export * from './clusterInsStatus'; export * from './clusterTypeInfos'; export * from './clusterTypes'; export * from './confLevels'; +export * from './dbClusterTypes'; export * from './dbSysExclude'; export * from './dbTypeInfos'; export * from './dbTypes'; @@ -12,7 +13,6 @@ export * from './machineTypes'; export * from './occupiedInnerHeight'; export * from './osTypes'; export * from './pipelineStatus'; -export * from './queryClusterTypes'; export * from './ticketTypeInfos'; export * from './ticketTypes'; export * from './userPersonalSettings'; diff --git a/dbm-ui/frontend/src/services/source/dbbase.ts b/dbm-ui/frontend/src/services/source/dbbase.ts index 8170495351..149d2ebc61 100644 --- a/dbm-ui/frontend/src/services/source/dbbase.ts +++ b/dbm-ui/frontend/src/services/source/dbbase.ts @@ -106,6 +106,28 @@ export function checkInstance(params: { instance_addres // 查询全集群信息 export function queryAllTypeCluster(params: { + bk_biz_id: number; + cluster_types?: string; + immute_domain?: string; + phase?: string; + limit?: number; + offset?: number; +}) { + return http.get< + { + bk_cloud_id: number; + cluster_type: string; + id: number; + immute_domain: string; + major_version: string; + name: string; + region: string; + }[] + >(`${path}/simple_query_cluster/`, params); +} + +// 全集群列表 +export function queryAllTypeClusterList(params: { bk_biz_id?: number; // 业务id cluster_types?: string; // 集群类型(逗号间隔) immute_domain?: string; // 集群域名 @@ -140,5 +162,13 @@ export function queryAllTypeCluster(params: { status: string; }[] > - >(`${path}/simple_query_cluster/`, params); + >(`${path}/simple_query_cluster_v2/`, params); +} +export type ClusterInfo = ServiceReturnType['results'][number]; + +/** + * 根据用户手动输入的域名列表查询 + */ +export function checkDomains(params: { domains: string[] }) { + return http.post(`${path}/check_domains/`, params); } diff --git a/dbm-ui/frontend/src/services/source/mysql.ts b/dbm-ui/frontend/src/services/source/mysql.ts index edf6079f95..4e9077ac8f 100644 --- a/dbm-ui/frontend/src/services/source/mysql.ts +++ b/dbm-ui/frontend/src/services/source/mysql.ts @@ -39,10 +39,3 @@ export function getClusterList(params: { }) { return http.post>(`/apis/mysql/query_clusters/`, params); } - -/** - * 根据用户手动输入的域名列表查询 - */ -export function checkDomains(params: { domains: Array }) { - return http.post>(`/apis/mysql/check_domains/`, params); -} diff --git a/dbm-ui/frontend/src/views/cluster-standardize/components/cluster-selector/Index.vue b/dbm-ui/frontend/src/views/cluster-standardize/components/cluster-selector/Index.vue index c1bde80c03..ea3f761319 100644 --- a/dbm-ui/frontend/src/views/cluster-standardize/components/cluster-selector/Index.vue +++ b/dbm-ui/frontend/src/views/cluster-standardize/components/cluster-selector/Index.vue @@ -68,30 +68,26 @@ + -