{ t('集群') }: - { row.cluster_name } + { data.map(dataItem => dataItem.cluster_name).join(',') }
), @@ -796,7 +827,7 @@ bk_biz_id: currentBizId, ticket_type: TicketTypes.MONGODB_ENABLE, details: { - cluster_ids: [row.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }) .then((res) => { @@ -806,15 +837,15 @@ }); }; - const handleDisableCluster = (row: MongodbModel) => { - disableCluster(row); + const handleDisableCluster = (data: MongodbModel[]) => { + disableCluster(data); }; - const handleDeleteCluster = (row: MongodbModel) => { - const { cluster_name: name } = row; + const handleDeleteCluster = (data: MongodbModel[]) => { + const name = data.map((dataItem) => dataItem.cluster_name).join(',') InfoBox({ type: 'warning', - title: t('确定删除该集群'), + title: t('确定删除集群'), confirmText: t('删除'), confirmButtonTheme: 'danger', contentAlign: 'left', @@ -831,7 +862,7 @@ bk_biz_id: currentBizId, ticket_type: TicketTypes.MONGODB_DESTROY, details: { - cluster_ids: [row.id], + cluster_ids: data.map((dataItem) => dataItem.id), }, }) .then((res) => { diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/replica-set-list/hooks/useDisableCluster.tsx b/dbm-ui/frontend/src/views/db-manage/mongodb/replica-set-list/hooks/useDisableCluster.tsx index 4f64337d37..d19f539d5a 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/replica-set-list/hooks/useDisableCluster.tsx +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/replica-set-list/hooks/useDisableCluster.tsx @@ -27,14 +27,15 @@ export const useDisableCluster = () => { const { currentBizId } = useGlobalBizs(); const ticketMessage = useTicketMessage(); - const diabledCluster = (data: { cluster_name: string; id: number }) => { + const diabledCluster = (data: { cluster_name: string; id: number }[]) => { InfoBox({ type: 'warning', - title: t('确定禁用该集群'), + title: t('确定禁用集群'), content: () => ( <>- {t('集群')}:{data.cluster_name} + {t('集群')}: + {data.map((dataItem) => dataItem.cluster_name).join(',')}
{t('被禁用后将无法访问,如需恢复访问,可以再次「启用」')}
> @@ -45,7 +46,7 @@ export const useDisableCluster = () => { bk_biz_id: currentBizId, ticket_type: TicketTypes.MONGODB_DISABLE, details: { - cluster_ids: [data.id], + cluster_ids: data.map((dataItem) => dataItem.id), }, }).then((res) => { ticketMessage(res.id); diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/detail/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/detail/Index.vue index 7c86e5e115..ba3e8baff4 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/detail/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/detail/Index.vue @@ -258,7 +258,7 @@ }; const handleDisableCluster = () => { - disableCluster(data.value!); + disableCluster([data.value!]); }; diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/list/Index.vue b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/list/Index.vue index 6f190cf826..6089c46734 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/list/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/components/list/Index.vue @@ -20,6 +20,11 @@ @click="handleApply"> {{ t('申请实例') }}{ t('集群') }: - { row.cluster_name } + { data.map(dataItem => dataItem.cluster_name).join(',') }
), @@ -810,7 +841,7 @@ bk_biz_id: currentBizId, ticket_type: TicketTypes.MONGODB_ENABLE, details: { - cluster_ids: [row.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }) .then((res) => { @@ -820,15 +851,15 @@ }); }; - const handleDisableCluster = (row: MongodbModel) => { - disableCluster(row); + const handleDisableCluster = (data: MongodbModel[]) => { + disableCluster(data); }; - const handleDeleteCluster = (row: MongodbModel) => { - const { cluster_name: name } = row; + const handleDeleteCluster = (data: MongodbModel[]) => { + const name = data.map(dataItem => dataItem.cluster_name).join(',') InfoBox({ type: 'warning', - title: t('确定删除该集群'), + title: t('确定删除集群'), confirmText: t('删除'), confirmButtonTheme: 'danger', contentAlign: 'left', @@ -845,7 +876,7 @@ bk_biz_id: currentBizId, ticket_type: TicketTypes.MONGODB_DESTROY, details: { - cluster_ids: [row.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }) .then((res) => { diff --git a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/hooks/useDisableCluster.tsx b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/hooks/useDisableCluster.tsx index b1b40fd35a..823918ce88 100644 --- a/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/hooks/useDisableCluster.tsx +++ b/dbm-ui/frontend/src/views/db-manage/mongodb/shared-cluster-list/hooks/useDisableCluster.tsx @@ -27,14 +27,15 @@ export const useDisableCluster = () => { const { currentBizId } = useGlobalBizs(); const ticketMessage = useTicketMessage(); - const diabledCluster = (data: { cluster_name: string; id: number }) => { + const diabledCluster = (data: { cluster_name: string; id: number }[]) => { InfoBox({ type: 'warning', title: t('确定禁用该集群'), content: () => ( <>- {t('集群')}:{data.cluster_name} + {t('集群')}: + {data.map((dataItem) => dataItem.cluster_name).join(',')}
{t('被禁用后将无法访问,如需恢复访问,可以再次「启用」')}
> @@ -46,7 +47,7 @@ export const useDisableCluster = () => { bk_biz_id: currentBizId, ticket_type: TicketTypes.MONGODB_DISABLE, details: { - cluster_ids: [data.id], + cluster_ids: data.map((dataItem) => dataItem.id), }, }; await createTicket(params).then((res) => { diff --git a/dbm-ui/frontend/src/views/db-manage/mysql/ha-cluster-list/components/List.vue b/dbm-ui/frontend/src/views/db-manage/mysql/ha-cluster-list/components/List.vue index 55195df2f1..ff982727d3 100644 --- a/dbm-ui/frontend/src/views/db-manage/mysql/ha-cluster-list/components/List.vue +++ b/dbm-ui/frontend/src/views/db-manage/mysql/ha-cluster-list/components/List.vue @@ -21,6 +21,11 @@ @click="handleApply"> {{ t('申请实例') }} +{t('集群【name】启用后将恢复访问', { name: data.cluster_name })}
- :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name: data.cluster_name })}
+ ?{t('集群【name】启用后将恢复访问', { name })}
+ :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name })}
}{t('集群【name】启用后将恢复访问', { name: data.cluster_name })}
- :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name: data.cluster_name })}
+ ?{t('集群【name】启用后将恢复访问', { name: clusterName })}
+ :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name: clusterName })}
} ), @@ -845,7 +875,7 @@ bk_biz_id: globalBizsStore.currentBizId, ticket_type: type, details: { - cluster_ids: [data.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }; await createTicket(params).then((res) => { @@ -859,18 +889,18 @@ /** * 删除集群 */ - const handleDeleteCluster = (data: TendbsingleModel) => { - const { cluster_name: name } = data; + const handleDeleteCluster = (data: TendbsingleModel[]) => { + const clusterName = data.map(dataItem => dataItem.cluster_name).join(',') InfoBox({ type: 'warning', - title: t('确定删除该集群'), + title: t('确定删除集群'), confirmText: t('删除'), confirmButtonTheme: 'danger', content: () => ({t('集群【name】被删除后_将进行以下操作', { name })}
-{t('1_删除xx集群', { name })}
-{t('2_删除xx实例数据_停止相关进程', { name })}
+{t('集群【name】被删除后_将进行以下操作', { name: clusterName })}
+{t('1_删除xx集群', { name: clusterName })}
+{t('2_删除xx实例数据_停止相关进程', { name: clusterName })}
3. {t('回收主机')}
{t('集群【name】启用后将恢复访问', { name: data.cluster_name })}
- :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name: data.cluster_name })}
+ ?{t('集群【name】启用后将恢复访问', { name })}
+ :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name })}
}{t('集群')} :{data.cluster_name}
+{t('集群')} :{data.map(dataItem => dataItem.cluster_name).join(',')}
{ isOpen ?{ t('启用后将恢复访问')}
@@ -895,7 +922,7 @@ bk_biz_id: currentBizId, ticket_type: type, details: { - cluster_ids: [data.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }); return true; @@ -906,8 +933,8 @@ /** * 删除集群 */ - const handleDeleteCluster = (data: SqlServerHaModel) => { - const { cluster_name: name } = data; + const handleDeleteCluster = (data: SqlServerHaModel[]) => { + const name = data.map(dataItem => dataItem.cluster_name).join(',') InfoBox({ type: 'warning', title: t('确定删除该集群'), @@ -926,7 +953,7 @@ bk_biz_id: currentBizId, ticket_type: TicketTypes.SQLSERVER_DESTROY, details: { - cluster_ids: [data.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }); return false; diff --git a/dbm-ui/frontend/src/views/db-manage/sqlserver/single-cluster/components/List.vue b/dbm-ui/frontend/src/views/db-manage/sqlserver/single-cluster/components/List.vue index d7d8b99b80..320f430362 100644 --- a/dbm-ui/frontend/src/views/db-manage/sqlserver/single-cluster/components/List.vue +++ b/dbm-ui/frontend/src/views/db-manage/sqlserver/single-cluster/components/List.vue @@ -7,6 +7,11 @@ @click="handleApply"> {{ t('申请实例') }} +{t('集群')} :{data.cluster_name}
+{t('集群')} :{data.map(dataItem => dataItem.cluster_name).join(',')}
{ isOpen ?{ t('启用后将恢复访问')}
@@ -716,7 +744,7 @@ bk_biz_id: currentBizId, ticket_type: type, details: { - cluster_ids: [data.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }); return true; @@ -727,11 +755,11 @@ /** * 删除集群 */ - const handleDeleteCluster = (data: SqlServerSingleModel) => { - const { cluster_name: name } = data; + const handleDeleteCluster = (data: SqlServerSingleModel[]) => { + const name = data.map(dataItem => dataItem.cluster_name).join(',') InfoBox({ type: 'warning', - title: t('确定删除该集群'), + title: t('确定删除集群'), confirmText: t('删除'), confirmButtonTheme: 'danger', content: () => ( @@ -747,7 +775,7 @@ bk_biz_id: currentBizId, ticket_type: TicketTypes.SQLSERVER_DESTROY, details: { - cluster_ids: [data.id], + cluster_ids: data.map(dataItem => dataItem.id), }, }); return false; diff --git a/dbm-ui/frontend/src/views/db-manage/tendb-cluster/list/components/list/Index.vue b/dbm-ui/frontend/src/views/db-manage/tendb-cluster/list/components/list/Index.vue index 4bb8dd4444..19a6b20488 100644 --- a/dbm-ui/frontend/src/views/db-manage/tendb-cluster/list/components/list/Index.vue +++ b/dbm-ui/frontend/src/views/db-manage/tendb-cluster/list/components/list/Index.vue @@ -21,6 +21,11 @@ @click="handleApply"> {{ t('申请实例') }} +{t('集群【name】启用后将恢复访问', { name: data.cluster_name })}
- :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name: data.cluster_name })}
+ ?{t('集群【name】启用后将恢复访问', { name })}
+ :{t('集群【name】被禁用后将无法访问_如需恢复访问_可以再次「启用」', { name })}
}