+
+ {t('集群')} :
+
+ {clusterNames}
+
+
+
{t('删除后将产生以下影响')}:
+
1. {t('删除xxx集群', [clusterNames])}
+
2. {t('删除xxx实例数据,停止相关进程', [clusterNames])}
+
3. {t('回收主机')}:
+
+ );
+ InfoBox({
+ title: t('确定删除集群?'),
+ subTitle,
+ infoType: 'warning',
+ theme: 'danger',
+ confirmText: t('删除'),
+ cancelText: t('取消'),
+ headerAlign: 'center',
+ contentAlign: 'left',
+ footerAlign: 'center',
+ onConfirm: () => {
+ handleConfirm(ticketTypeInfo.delete, dataList);
+ },
+ });
+ };
+
+ return {
+ handleDisableCluster,
+ handleEnableCluster,
+ handleDeleteCluster,
+ };
+};
diff --git a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/Backup.vue b/dbm-ui/frontend/src/views/db-manage/common/redis-backup/Index.vue
similarity index 99%
rename from dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/Backup.vue
rename to dbm-ui/frontend/src/views/db-manage/common/redis-backup/Index.vue
index 34932dee45..4bb4c86504 100644
--- a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/Backup.vue
+++ b/dbm-ui/frontend/src/views/db-manage/common/redis-backup/Index.vue
@@ -88,7 +88,7 @@
import { generateId } from '@utils';
- import BatchEdit from './BatchEdit.vue';
+ import BatchEdit from './components/BatchEdit.vue';
interface DataItem extends RedisModel {
target: string,
diff --git a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/BatchEdit.vue b/dbm-ui/frontend/src/views/db-manage/common/redis-backup/components/BatchEdit.vue
similarity index 100%
rename from dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/BatchEdit.vue
rename to dbm-ui/frontend/src/views/db-manage/common/redis-backup/components/BatchEdit.vue
diff --git a/dbm-ui/frontend/src/views/db-manage/common/redis-backup/hooks/useShowBackup.ts b/dbm-ui/frontend/src/views/db-manage/common/redis-backup/hooks/useShowBackup.ts
new file mode 100644
index 0000000000..74365af676
--- /dev/null
+++ b/dbm-ui/frontend/src/views/db-manage/common/redis-backup/hooks/useShowBackup.ts
@@ -0,0 +1,49 @@
+/*
+ * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
+ *
+ * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at https://opensource.org/licenses/MIT
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ * the specific language governing permissions and limitations under the License.
+ */
+
+import _ from 'lodash';
+
+import RedisModel from '@services/model/redis/redis';
+
+import { TicketTypes } from '@common/const';
+
+import { messageWarn } from '@utils';
+
+import { t } from '@locales/index';
+
+export const useShowBackup = () => {
+ const state = reactive({
+ isShow: false,
+ data: [] as RedisModel[],
+ });
+
+ const handleShow = (data: RedisModel[]) => {
+ if (
+ data.some(
+ (item) =>
+ item.operations.length > 0 &&
+ item.operations.map((op) => op.ticket_type).includes(TicketTypes.REDIS_INSTANCE_DESTROY),
+ )
+ ) {
+ messageWarn(t('选中集群存在删除中的集群无法操作'));
+ return;
+ }
+ state.isShow = true;
+ state.data = _.cloneDeep(data);
+ };
+
+ return {
+ state,
+ handleShow,
+ };
+};
diff --git a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/DeleteKeys.vue b/dbm-ui/frontend/src/views/db-manage/common/redis-delete-keys/Index.vue
similarity index 99%
rename from dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/DeleteKeys.vue
rename to dbm-ui/frontend/src/views/db-manage/common/redis-delete-keys/Index.vue
index 296dbd62d9..19df359c18 100644
--- a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/DeleteKeys.vue
+++ b/dbm-ui/frontend/src/views/db-manage/common/redis-delete-keys/Index.vue
@@ -109,7 +109,7 @@
import { generateId } from '@utils';
- import BatchEditKeys from './BatchEditKeys.vue';
+ import BatchEditKeys from '../RedisBatchEditKeys.vue';
interface DataItem extends RedisModel {
white_regex: string,
diff --git a/dbm-ui/frontend/src/views/db-manage/common/redis-delete-keys/hooks/useShowDeleteKeys.ts b/dbm-ui/frontend/src/views/db-manage/common/redis-delete-keys/hooks/useShowDeleteKeys.ts
new file mode 100644
index 0000000000..29344f9063
--- /dev/null
+++ b/dbm-ui/frontend/src/views/db-manage/common/redis-delete-keys/hooks/useShowDeleteKeys.ts
@@ -0,0 +1,53 @@
+/*
+ * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
+ *
+ * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at https://opensource.org/licenses/MIT
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ * the specific language governing permissions and limitations under the License.
+ */
+
+import _ from 'lodash';
+
+import RedisModel from '@services/model/redis/redis';
+
+import { TicketTypes } from '@common/const';
+
+import { messageWarn } from '@utils';
+
+import { t } from '@locales/index';
+
+export const useShowDeleteKeys = () => {
+ const state = reactive({
+ isShow: false,
+ data: [] as RedisModel[],
+ });
+
+ const handleShow = (data: RedisModel[]) => {
+ if (
+ data.some(
+ (item) =>
+ item.operations.length > 0 &&
+ item.operations.map((op) => op.ticket_type).includes(TicketTypes.REDIS_INSTANCE_DESTROY),
+ )
+ ) {
+ messageWarn(t('选中集群存在删除中的集群无法操作'));
+ return;
+ }
+ if (data.some((item) => item.bk_cloud_id > 0)) {
+ messageWarn(t('暂不支持跨管控区域删除Key'));
+ return;
+ }
+ state.isShow = true;
+ state.data = _.cloneDeep(data);
+ };
+
+ return {
+ state,
+ handleShow,
+ };
+};
diff --git a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/ExtractKeys.vue b/dbm-ui/frontend/src/views/db-manage/common/redis-extract-keys/Index.vue
similarity index 99%
rename from dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/ExtractKeys.vue
rename to dbm-ui/frontend/src/views/db-manage/common/redis-extract-keys/Index.vue
index ceb918eb7b..94da7abb80 100644
--- a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/ExtractKeys.vue
+++ b/dbm-ui/frontend/src/views/db-manage/common/redis-extract-keys/Index.vue
@@ -108,7 +108,7 @@
import { generateId } from '@utils';
- import BatchEditKeys from './BatchEditKeys.vue';
+ import BatchEditKeys from '../RedisBatchEditKeys.vue';
interface ExtractItem extends RedisModel {
white_regex: string,
diff --git a/dbm-ui/frontend/src/views/db-manage/common/redis-extract-keys/hooks/useShowExtractKeys.ts b/dbm-ui/frontend/src/views/db-manage/common/redis-extract-keys/hooks/useShowExtractKeys.ts
new file mode 100644
index 0000000000..1c2239924a
--- /dev/null
+++ b/dbm-ui/frontend/src/views/db-manage/common/redis-extract-keys/hooks/useShowExtractKeys.ts
@@ -0,0 +1,54 @@
+/*
+ * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
+ *
+ * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at https://opensource.org/licenses/MIT
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ * the specific language governing permissions and limitations under the License.
+ */
+
+import _ from 'lodash';
+
+import RedisModel from '@services/model/redis/redis';
+
+import { TicketTypes } from '@common/const';
+
+import { messageWarn } from '@utils';
+
+import { t } from '@locales/index';
+
+export const useShowExtractKeys = () => {
+ const state = reactive({
+ isShow: false,
+ data: [] as RedisModel[],
+ });
+
+ const handleShow = (data: RedisModel[]) => {
+ if (
+ data.some(
+ (item) =>
+ item.operations.length > 0 &&
+ item.operations.map((op) => op.ticket_type).includes(TicketTypes.REDIS_INSTANCE_DESTROY),
+ )
+ ) {
+ messageWarn(t('选中集群存在删除中的集群无法操作'));
+ return;
+ }
+ if (data.some((item) => item.bk_cloud_id > 0)) {
+ messageWarn(t('暂不支持跨管控区域提取Key'));
+ return;
+ }
+
+ state.isShow = true;
+ state.data = _.cloneDeep(data);
+ };
+
+ return {
+ state,
+ handleShow,
+ };
+};
diff --git a/dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/Purge.vue b/dbm-ui/frontend/src/views/db-manage/common/redis-purge/Index.vue
similarity index 100%
rename from dbm-ui/frontend/src/views/db-manage/redis/common/cluster-oprations/Purge.vue
rename to dbm-ui/frontend/src/views/db-manage/common/redis-purge/Index.vue
diff --git a/dbm-ui/frontend/src/views/db-manage/common/redis-purge/hooks/useShowPurge.ts b/dbm-ui/frontend/src/views/db-manage/common/redis-purge/hooks/useShowPurge.ts
new file mode 100644
index 0000000000..98c8262199
--- /dev/null
+++ b/dbm-ui/frontend/src/views/db-manage/common/redis-purge/hooks/useShowPurge.ts
@@ -0,0 +1,50 @@
+/*
+ * TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available.
+ *
+ * Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at https://opensource.org/licenses/MIT
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for
+ * the specific language governing permissions and limitations under the License.
+ */
+
+import _ from 'lodash';
+
+import RedisModel from '@services/model/redis/redis';
+
+import { TicketTypes } from '@common/const';
+
+import { messageWarn } from '@utils';
+
+import { t } from '@locales/index';
+
+export const useShowPurge = () => {
+ const state = reactive({
+ isShow: false,
+ data: [] as RedisModel[],
+ });
+
+ const handleShow = (data: RedisModel[]) => {
+ if (
+ data.some(
+ (item) =>
+ item.operations.length > 0 &&
+ item.operations.map((op) => op.ticket_type).includes(TicketTypes.REDIS_INSTANCE_DESTROY),
+ )
+ ) {
+ messageWarn(t('选中集群存在删除中的集群无法操作'));
+ return;
+ }
+
+ state.isShow = true;
+ state.data = _.cloneDeep(data);
+ };
+
+ return {
+ state,
+ handleShow,
+ };
+};
diff --git a/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue b/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue
index 6937208303..e5e6609b34 100644
--- a/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue
+++ b/dbm-ui/frontend/src/views/db-manage/doris/list/components/list/Index.vue
@@ -89,7 +89,7 @@