From 2170937d88fac7d8de020366b2f375da0d0f4b96 Mon Sep 17 00:00:00 2001 From: iSecloud <869820505@qq.com> Date: Fri, 15 Mar 2024 17:56:24 +0800 Subject: [PATCH] refactor(other): merge v1.3.0 to v1.4.0 #3564 --- .../db_services/mysql/open_area/handlers.py | 6 +- .../mysql/permission/db_account/handlers.py | 1 + .../backend/flow/utils/mysql/mysql_db_meta.py | 1 + .../instance-selector-new/Index.vue | 514 ------------------ .../components/instance-selector/Index.vue | 67 ++- .../components/CollapseMini.vue | 101 ---- .../instance-selector/components/PanelTab.vue | 98 ---- .../components/PreviewResult.vue | 214 -------- .../components/RenderManualHost.vue | 253 --------- .../components/RenderTopoHost.vue | 339 ------------ .../components/mongo/Index.vue | 2 +- .../components/mongo/table/Index.vue | 4 +- .../components/mongo/table/useTableData.ts | 0 .../components/mongo/useTopoData.ts | 0 .../db-replace/pages/page1/Index.vue | 2 +- .../components/RenderData/RenderHost.vue | 2 +- 16 files changed, 68 insertions(+), 1536 deletions(-) delete mode 100644 dbm-ui/frontend/src/components/instance-selector-new/Index.vue delete mode 100644 dbm-ui/frontend/src/components/instance-selector/components/CollapseMini.vue delete mode 100644 dbm-ui/frontend/src/components/instance-selector/components/PanelTab.vue delete mode 100644 dbm-ui/frontend/src/components/instance-selector/components/PreviewResult.vue delete mode 100644 dbm-ui/frontend/src/components/instance-selector/components/RenderManualHost.vue delete mode 100644 dbm-ui/frontend/src/components/instance-selector/components/RenderTopoHost.vue rename dbm-ui/frontend/src/components/{instance-selector-new => instance-selector}/components/mongo/Index.vue (99%) rename dbm-ui/frontend/src/components/{instance-selector-new => instance-selector}/components/mongo/table/Index.vue (99%) rename dbm-ui/frontend/src/components/{instance-selector-new => instance-selector}/components/mongo/table/useTableData.ts (100%) rename dbm-ui/frontend/src/components/{instance-selector-new => instance-selector}/components/mongo/useTopoData.ts (100%) diff --git a/dbm-ui/backend/db_services/mysql/open_area/handlers.py b/dbm-ui/backend/db_services/mysql/open_area/handlers.py index aad5bbfd44..dba8ba232b 100644 --- a/dbm-ui/backend/db_services/mysql/open_area/handlers.py +++ b/dbm-ui/backend/db_services/mysql/open_area/handlers.py @@ -18,8 +18,8 @@ from backend.components import DBPrivManagerApi from backend.db_meta.enums import ClusterType from backend.db_meta.models import Cluster +from backend.db_services.dbpermission.constants import AccountType from backend.db_services.mysql.open_area.models import TendbOpenAreaConfig -from backend.db_services.mysql.permission.constants import AccountType from backend.db_services.mysql.remote_service.handlers import RemoteServiceHandler @@ -122,7 +122,9 @@ def __get_openarea_rules_set(cls, config, config_data, operator, cluster_id__clu if not priv_ids: return [] - account_type = AccountType.TENDB if config.cluster_type == ClusterType.TenDBCluster else AccountType.MYSQL + account_type = ( + AccountType.TENDBCLUSTER if config.cluster_type == ClusterType.TenDBCluster else AccountType.MYSQL + ) authorize_rules = DBPrivManagerApi.list_account_rules( {"bk_biz_id": config.bk_biz_id, "ids": priv_ids, "cluster_type": account_type} ) diff --git a/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py b/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py index d7bb4fe785..bdc5d8d8f2 100644 --- a/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py +++ b/dbm-ui/backend/db_services/mysql/permission/db_account/handlers.py @@ -24,6 +24,7 @@ class MySQLAccountHandler(AccountHandler): """ 封装账号相关的处理操作 """ + def has_high_risk_privileges(self, rule_sets): """ - 判断是否有高危权限 diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py b/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py index ee075391d4..286c1fe1d6 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py @@ -13,6 +13,7 @@ from django.db.transaction import atomic +from backend.components import DBPrivManagerApi from backend.components.mysql_partition.client import DBPartitionApi from backend.configuration.constants import DBType from backend.db_meta import api diff --git a/dbm-ui/frontend/src/components/instance-selector-new/Index.vue b/dbm-ui/frontend/src/components/instance-selector-new/Index.vue deleted file mode 100644 index 8d18dc9a30..0000000000 --- a/dbm-ui/frontend/src/components/instance-selector-new/Index.vue +++ /dev/null @@ -1,514 +0,0 @@ - - - - - - - - - - - - - - - - - {{ t('确定') }} - - - - {{ t('取消') }} - - - - - - - - diff --git a/dbm-ui/frontend/src/components/instance-selector/Index.vue b/dbm-ui/frontend/src/components/instance-selector/Index.vue index d17164f42e..ce0c38bf53 100644 --- a/dbm-ui/frontend/src/components/instance-selector/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/Index.vue @@ -67,7 +67,7 @@ - - diff --git a/dbm-ui/frontend/src/components/instance-selector/components/PanelTab.vue b/dbm-ui/frontend/src/components/instance-selector/components/PanelTab.vue deleted file mode 100644 index 62ba70b237..0000000000 --- a/dbm-ui/frontend/src/components/instance-selector/components/PanelTab.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - {{ item.title }} - - - - - - - - diff --git a/dbm-ui/frontend/src/components/instance-selector/components/PreviewResult.vue b/dbm-ui/frontend/src/components/instance-selector/components/PreviewResult.vue deleted file mode 100644 index fd042f0063..0000000000 --- a/dbm-ui/frontend/src/components/instance-selector/components/PreviewResult.vue +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - {{ $t('结果预览') }} - - - - - - {{ $t('清空所有') }} - - - {{ $t('复制所有实例') }} - - - - - - - - - - - - {{ item.instance_address }} - - - - - - - - - - diff --git a/dbm-ui/frontend/src/components/instance-selector/components/RenderManualHost.vue b/dbm-ui/frontend/src/components/instance-selector/components/RenderManualHost.vue deleted file mode 100644 index d5a0d61c2f..0000000000 --- a/dbm-ui/frontend/src/components/instance-selector/components/RenderManualHost.vue +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - - - - - - diff --git a/dbm-ui/frontend/src/components/instance-selector/components/RenderTopoHost.vue b/dbm-ui/frontend/src/components/instance-selector/components/RenderTopoHost.vue deleted file mode 100644 index 3a94832c53..0000000000 --- a/dbm-ui/frontend/src/components/instance-selector/components/RenderTopoHost.vue +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - diff --git a/dbm-ui/frontend/src/components/instance-selector-new/components/mongo/Index.vue b/dbm-ui/frontend/src/components/instance-selector/components/mongo/Index.vue similarity index 99% rename from dbm-ui/frontend/src/components/instance-selector-new/components/mongo/Index.vue rename to dbm-ui/frontend/src/components/instance-selector/components/mongo/Index.vue index 3382707ff3..dcdf61b1ca 100644 --- a/dbm-ui/frontend/src/components/instance-selector-new/components/mongo/Index.vue +++ b/dbm-ui/frontend/src/components/instance-selector/components/mongo/Index.vue @@ -79,7 +79,7 @@