From d7b2fa5ab43dd04cf7574580523b433ee09b52d4 Mon Sep 17 00:00:00 2001 From: hlinx <327159425@qq.com> Date: Thu, 7 Mar 2024 19:47:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20sqlserver=20=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=AE=B1=20#3485=20#=20Reviewed,=20transaction=20id:?= =?UTF-8?q?=2012171?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/.eslintrc.js | 2 +- dbm-ui/frontend/.prettierrc | 1 + dbm-ui/frontend/.vscode/settings.json | 59 +++ dbm-ui/frontend/env.d.ts | 1 + .../frontend/lib/bk-icon/fonts/iconcool.svg | 432 +++++++++--------- dbm-ui/frontend/lib/bk-icon/iconcool.json | 2 +- dbm-ui/frontend/lib/bk-icon/style.css | 3 + dbm-ui/frontend/package.json | 65 +-- .../cluster-authorize/ClusterAuthorize.vue | 16 +- .../src/components/cluster-selector/Index.vue | 45 +- .../components/sqlserver-ha/Index.vue | 17 +- .../components/sqlserver-single/Index.vue | 16 +- .../src/components/db-popconfirm/index.vue | 8 +- .../components/instance-selector/Index.vue | 66 ++- .../components/mongo/table/useTableData.ts | 11 +- .../components/mysql/table/useTableData.ts | 2 +- .../redis-host/table/useTableData.ts | 2 +- .../components/redis/table/useTableData.ts | 2 +- .../components/redis/useTopoData.ts | 2 +- .../components/sql-server/Index.vue | 271 +++++++++++ .../components/sql-server/table/Index.vue | 361 +++++++++++++++ .../sql-server/table/useTableData.ts | 108 +++++ .../components/sql-server/useTopoData.ts | 112 +++++ .../tendb-cluster-host/table/useTableData.ts | 2 +- .../tendb-cluster/table/useTableData.ts | 4 +- .../src/components/render-table/Index.vue | 17 + .../render-table/columns/element/Index.vue | 79 ++++ .../render-table/columns/input/index.vue | 59 ++- .../render-table/columns/tag-input/index.vue | 214 +++++---- .../frontend/src/hooks/useFullscreenStyle.ts | 2 - .../frontend/src/hooks/useSQLTaskNotify.tsx | 1 + dbm-ui/frontend/src/layout/Index.vue | 1 + .../components/module-group/SqlServer.vue | 62 ++- dbm-ui/frontend/src/locales/zh-cn.json | 22 +- .../frontend/src/services/http/lib/request.ts | 51 +-- .../src/services/http/middleware/response.ts | 92 ++-- .../model/sqlserver/migrate-record.ts | 123 +++++ .../model/sqlserver/sqlserver-ha-cluster.ts | 13 +- .../model/sqlserver/sqlserver-ha-instance.ts | 52 ++- dbm-ui/frontend/src/services/source/dbbase.ts | 55 +-- .../frontend/src/services/source/instances.ts | 6 +- .../src/services/source/mysqlCluster.ts | 79 ++-- .../frontend/src/services/source/sqlImport.ts | 28 +- .../src/services/source/sqlServerImport.ts | 26 ++ .../src/services/source/sqlServerMigrate.ts | 37 ++ .../src/services/source/sqlserveHaCluster.ts | 12 + .../frontend/src/services/source/sqlserver.ts | 69 ++- .../frontend/src/services/source/ticket.tsx | 223 +++++---- dbm-ui/frontend/src/types/vite-env.d.ts | 4 + dbm-ui/frontend/src/utils/checkDbConsole.ts | 2 +- .../views/mysql/common/edit-field/DbName.vue | 48 +- .../mysql/common/edit-field/TableName.vue | 5 +- .../src/views/mysql/common/edit/Select.vue | 4 +- .../components/detail/Index.vue | 4 +- .../mysql/rollback/pages/page1/Index.vue | 14 +- .../components/sql-file/local-file/Index.vue | 147 +++--- .../components/RenderData/RenderCluster.vue | 83 ++-- .../components/RenderData/RenderCluster.vue | 101 ++-- .../src/views/sqlserver-manage/Index.vue | 3 + .../views/sqlserver-manage/common/EditDb.vue | 79 ++++ .../sqlserver-manage/common/RenderCluster.vue | 217 +++++++++ .../common/edit-rename-info/Index.vue | 138 ++++++ .../edit-rename-info/components/ClusterDb.vue | 109 +++++ .../edit-rename-info/components/ExportBtn.vue | 42 ++ .../edit-rename-info/components/ImportBtn.vue | 73 +++ .../components/rename-list/Index.vue | 85 ++++ .../components/rename-list/RenderRow.vue | 188 ++++++++ .../data-migrate-record/Index.vue | 176 +++++++ .../sqlserver-manage/data-migrate/Index.vue | 49 ++ .../data-migrate/pages/page1/Index.vue | 236 ++++++++++ .../page1/components/render-data/Index.vue | 83 ++++ .../components/render-data/RenderCluster.vue | 146 ++++++ .../components/render-data/RenderRename.vue | 187 ++++++++ .../page1/components/render-data/Row.vue | 213 +++++++++ .../data-migrate/pages/page2/Index.vue | 87 ++++ .../db-backup/pages/page1/Index.vue | 37 +- .../components/FianlDbReviewer/Index.vue | 37 +- .../components/RenderData/RenderDomain.vue | 69 +-- .../page1/components/RenderData/RenderRow.vue | 37 +- .../views/sqlserver-manage/db-clear/Index.vue | 49 ++ .../db-clear/pages/page1/Index.vue | 221 +++++++++ .../page1/components/RenderData/Index.vue | 104 +++++ .../RenderData/RenderClearDbName.vue | 159 +++++++ .../components/RenderData/RenderClearMode.vue | 85 ++++ .../components/RenderData/RenderCluster.vue | 146 ++++++ .../pages/page1/components/RenderData/Row.vue | 198 ++++++++ .../RenderData/render-clear-db-name/Index.vue | 165 +++++++ .../components/RenderDbList.vue | 9 + .../db-clear/pages/page2/Index.vue | 87 ++++ .../sqlserver-manage/db-rename/Index.vue | 49 ++ .../db-rename/pages/page1/Index.vue | 212 +++++++++ .../page1/components/RenderData/Index.vue | 80 ++++ .../components/RenderData/RenderCluster.vue | 157 +++++++ .../components/RenderData/RenderDbName.vue | 126 +++++ .../pages/page1/components/RenderData/Row.vue | 138 ++++++ .../db-rename/pages/page2/Index.vue | 87 ++++ .../master-failover/index.vue | 49 ++ .../master-failover/pages/page1/Index.vue | 210 +++++++++ .../pages/page1/components/BatchEntry.vue | 334 ++++++++++++++ .../page1/components/RenderData/Index.vue | 67 +++ .../components/RenderData/RenderCluster.vue | 107 +++++ .../components/RenderData/RenderMaster.vue | 139 ++++++ .../components/RenderData/RenderSlave.vue | 125 +++++ .../pages/page1/components/RenderData/Row.vue | 183 ++++++++ .../master-failover/pages/page2/Index.vue | 87 ++++ .../master-slave-clone/index.vue | 49 ++ .../master-slave-clone/pages/page1/Index.vue | 182 ++++++++ .../pages/page1/components/BatchEntry.vue | 351 ++++++++++++++ .../page1/components/RenderData/Index.vue | 63 +++ .../RenderData/RenderMasterSlaveHost.vue | 266 +++++++++++ .../pages/page1/components/RenderData/Row.vue | 191 ++++++++ .../master-slave-clone/pages/page2/Index.vue | 87 ++++ .../master-slave-swap/index.vue | 49 ++ .../master-slave-swap/pages/page1/Index.vue | 189 ++++++++ .../page1/components/RenderData/Index.vue | 68 +++ .../components/RenderData/RenderCluster.vue | 109 +++++ .../components/RenderData/RenderMaster.vue | 151 ++++++ .../components/RenderData/RenderSlave.vue | 117 +++++ .../pages/page1/components/RenderData/Row.vue | 182 ++++++++ .../master-slave-swap/pages/page2/Index.vue | 87 ++++ .../permission/components/CreateRule.vue | 2 +- .../views/sqlserver-manage/rollback/Index.vue | 49 ++ .../rollback/pages/page1/Index.vue | 130 ++++++ .../page1/components/common/RenderCluster.vue | 217 +++++++++ .../page1/components/common/RenderMode.vue | 214 +++++++++ .../pages/page1/components/local/Index.vue | 119 +++++ .../local/components/RenderData.vue | 83 ++++ .../local/components/RenderRename.vue | 191 ++++++++ .../page1/components/local/components/Row.vue | 229 ++++++++++ .../page1/components/other-cluster/Index.vue | 126 +++++ .../other-cluster/components/RenderData.vue | 88 ++++ .../other-cluster/components/RenderRename.vue | 186 ++++++++ .../other-cluster/components/Row.vue | 242 ++++++++++ .../rollback/pages/page2/Index.vue | 87 ++++ .../src/views/sqlserver-manage/routes.ts | 123 ++++- .../sqlserver-manage/slave-add/index.vue | 49 ++ .../slave-add/pages/page1/Index.vue | 184 ++++++++ .../page1/components/RenderData/Index.vue | 67 +++ .../components/RenderData/RenderCluster.vue | 167 +++++++ .../components/RenderData/RenderSlaveHost.vue | 156 +++++++ .../pages/page1/components/RenderData/Row.vue | 169 +++++++ .../slave-add/pages/page2/Index.vue | 87 ++++ .../sqlserver-manage/slave-rebuild/index.vue | 49 ++ .../slave-rebuild/pages/page1/Index.vue | 86 ++++ .../pages/page1/components/new-host/Index.vue | 188 ++++++++ .../new-host/components/RenderData/Index.vue | 81 ++++ .../components/RenderData/RenderCluster.vue | 96 ++++ .../components/RenderData/RenderNewSlave.vue | 291 ++++++++++++ .../components/RenderData/RenderOldSlave.vue | 129 ++++++ .../new-host/components/RenderData/Row.vue | 134 ++++++ .../components/RenderData/useValidtor.ts | 89 ++++ .../page1/components/original-host/Index.vue | 191 ++++++++ .../components/RenderData/Index.vue | 76 +++ .../components/RenderData/RenderCluster.vue | 86 ++++ .../components/RenderData/RenderSlave.vue | 121 +++++ .../components/RenderData/Row.vue | 118 +++++ .../slave-rebuild/pages/page2/Index.vue | 87 ++++ .../sqlserver-manage/sql-execute/index.vue | 49 ++ .../sql-execute/pages/page1/Index.vue | 184 ++++++++ .../pages/page1/components/ClusterIds.vue | 213 +++++++++ .../pages/page1/components/TaskTips.vue | 149 ++++++ .../pages/page1/components/TicketMode.vue | 193 ++++++++ .../pages/page1/components/backup/Index.vue | 120 +++++ .../components/backup/RenderData/Index.vue | 42 ++ .../backup/RenderData/RenderDbs.vue | 68 +++ .../components/backup/RenderData/Row.vue | 182 ++++++++ .../components/execute-db-infos/Index.vue | 96 ++++ .../execute-db-infos/RenderData/Index.vue | 38 ++ .../RenderData/RenderDbName.vue | 133 ++++++ .../execute-db-infos/RenderData/RenderDbs.vue | 38 ++ .../execute-db-infos/RenderData/Row.vue | 159 +++++++ .../components/execute-sql-file/Index.vue | 91 ++++ .../execute-sql-file/editor/Index.vue | 225 +++++++++ .../execute-sql-file/editor/MessageList.vue | 181 ++++++++ .../execute-sql-file/local-file/Index.vue | 393 ++++++++++++++++ .../local-file/SqlFileList.vue | 161 +++++++ .../local-file/components/CheckError.vue | 49 ++ .../local-file/components/CheckSuccess.vue | 36 ++ .../local-file/components/FileList.vue | 283 ++++++++++++ .../execute-sql-file/manual-input/Index.vue | 216 +++++++++ .../components/SyntaxChecking.vue | 34 ++ .../manual-input/components/SyntaxError.vue | 32 ++ .../manual-input/components/SyntaxSuccess.vue | 32 ++ .../components/execute-sql-file/utils.ts | 14 + .../sql-execute/pages/page2/Index.vue | 99 ++++ .../views/sqlserver-manage/toolbox-menu.ts | 118 +++++ .../views/sqlserver-manage/toolbox/Index.vue | 94 ++++ .../toolbox/components/toolbox-side/Index.vue | 332 ++++++++++++++ .../toolbox-side/components/MenuGroup.vue | 115 +++++ .../toolbox-side/components/TaskCount.vue | 133 ++++++ dbm-ui/frontend/tsconfig.app.json | 33 ++ dbm-ui/frontend/tsconfig.config.json | 8 - dbm-ui/frontend/tsconfig.json | 42 +- dbm-ui/frontend/tsconfig.node.json | 19 + dbm-ui/frontend/vite.config.mts | 9 - 195 files changed, 19240 insertions(+), 1110 deletions(-) create mode 100644 dbm-ui/frontend/.vscode/settings.json create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/sql-server/Index.vue create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/Index.vue create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/useTableData.ts create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/sql-server/useTopoData.ts create mode 100644 dbm-ui/frontend/src/components/render-table/columns/element/Index.vue create mode 100644 dbm-ui/frontend/src/services/model/sqlserver/migrate-record.ts create mode 100644 dbm-ui/frontend/src/services/source/sqlServerImport.ts create mode 100644 dbm-ui/frontend/src/services/source/sqlServerMigrate.ts create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/EditDb.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ClusterDb.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ExportBtn.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ImportBtn.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/RenderRow.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate-record/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderRename.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/components/RenderData/RenderClearDbName.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/components/RenderData/RenderClearMode.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/components/RenderData/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/components/RenderData/render-clear-db-name/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page1/components/RenderData/render-clear-db-name/components/RenderDbList.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-clear/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-rename/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-rename/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-rename/pages/page1/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-rename/pages/page1/components/RenderData/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-rename/pages/page1/components/RenderData/RenderDbName.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-rename/pages/page1/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/db-rename/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page1/components/BatchEntry.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page1/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page1/components/RenderData/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page1/components/RenderData/RenderMaster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page1/components/RenderData/RenderSlave.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page1/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-failover/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-clone/index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-clone/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-clone/pages/page1/components/BatchEntry.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-clone/pages/page1/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-clone/pages/page1/components/RenderData/RenderMasterSlaveHost.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-clone/pages/page1/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-clone/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/pages/page1/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/pages/page1/components/RenderData/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/pages/page1/components/RenderData/RenderMaster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/pages/page1/components/RenderData/RenderSlave.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/pages/page1/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/master-slave-swap/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/common/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/common/RenderMode.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/local/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/local/components/RenderData.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/local/components/RenderRename.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/local/components/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/other-cluster/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/other-cluster/components/RenderData.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/other-cluster/components/RenderRename.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page1/components/other-cluster/components/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/rollback/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-add/index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-add/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-add/pages/page1/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-add/pages/page1/components/RenderData/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-add/pages/page1/components/RenderData/RenderSlaveHost.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-add/pages/page1/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-add/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/new-host/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/new-host/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/new-host/components/RenderData/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/new-host/components/RenderData/RenderNewSlave.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/new-host/components/RenderData/RenderOldSlave.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/new-host/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/new-host/components/RenderData/useValidtor.ts create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/original-host/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/original-host/components/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/original-host/components/RenderData/RenderCluster.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/original-host/components/RenderData/RenderSlave.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page1/components/original-host/components/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/slave-rebuild/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/ClusterIds.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/TaskTips.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/TicketMode.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/backup/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/backup/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/backup/RenderData/RenderDbs.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/backup/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-db-infos/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-db-infos/RenderData/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-db-infos/RenderData/RenderDbName.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-db-infos/RenderData/RenderDbs.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-db-infos/RenderData/Row.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/editor/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/editor/MessageList.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/local-file/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/local-file/SqlFileList.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/local-file/components/CheckError.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/local-file/components/CheckSuccess.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/local-file/components/FileList.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/manual-input/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/manual-input/components/SyntaxChecking.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/manual-input/components/SyntaxError.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/manual-input/components/SyntaxSuccess.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page1/components/execute-sql-file/utils.ts create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/sql-execute/pages/page2/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/toolbox-menu.ts create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/toolbox/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/toolbox/components/toolbox-side/Index.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/toolbox/components/toolbox-side/components/MenuGroup.vue create mode 100644 dbm-ui/frontend/src/views/sqlserver-manage/toolbox/components/toolbox-side/components/TaskCount.vue create mode 100644 dbm-ui/frontend/tsconfig.app.json delete mode 100644 dbm-ui/frontend/tsconfig.config.json create mode 100644 dbm-ui/frontend/tsconfig.node.json diff --git a/dbm-ui/frontend/.eslintrc.js b/dbm-ui/frontend/.eslintrc.js index ea7f331419..8bc63d4ff6 100644 --- a/dbm-ui/frontend/.eslintrc.js +++ b/dbm-ui/frontend/.eslintrc.js @@ -129,7 +129,7 @@ module.exports = { ], 'vue/prefer-separate-static-class': 'error', 'vue/prefer-true-attribute-shorthand': 'error', - 'vue/script-indent': ['error', 2, { baseIndent: 1 }], + 'vue/script-indent': ['off', 2, { baseIndent: 1 }], 'vue/component-name-in-template-casing': [ 'error', 'PascalCase', diff --git a/dbm-ui/frontend/.prettierrc b/dbm-ui/frontend/.prettierrc index 1858e9d892..b544d20e72 100644 --- a/dbm-ui/frontend/.prettierrc +++ b/dbm-ui/frontend/.prettierrc @@ -2,6 +2,7 @@ "plugins": [ "prettier-plugin-curly" ], + "$schema": "https://json.schemastore.org/prettierrc", "semi": true, "quoteProps": "as-needed", "jsxSingleQuote": true, diff --git a/dbm-ui/frontend/.vscode/settings.json b/dbm-ui/frontend/.vscode/settings.json new file mode 100644 index 0000000000..644b5c45bb --- /dev/null +++ b/dbm-ui/frontend/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "eslint.validate": ["javascript", "javascriptreact", "html", "vue"], + "eslint.alwaysShowStatus": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit" + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[html]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[css]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "editor.formatOnSave": true, + "editor.tabSize": 2, + "css.validate": false, + "stylelint.enable": true, + "scss.validate": false, + "stylelint.validate": ["css", "scss", "vue"], + "preCI.localCodeCheck.filter.whitePath": "", + "preCI.localCodeCheck.filter.skipPath": "", + "preCI.localCodeCheck.checkerSet.JS": ["standard_js"], + "peacock.remoteColor": "#45e35f", + "bk-code-ai.enable": true, + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#71ea85", + "activityBar.background": "#71ea85", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#8874ea", + "activityBarBadge.foreground": "#15202b", + "commandCenter.border": "#15202b99", + "sash.hoverBorder": "#71ea85", + "statusBar.background": "#45e35f", + "statusBar.foreground": "#15202b", + "statusBarItem.hoverBackground": "#20d53e", + "statusBarItem.remoteBackground": "#45e35f", + "statusBarItem.remoteForeground": "#15202b", + "titleBar.activeBackground": "#45e35f", + "titleBar.activeForeground": "#15202b", + "titleBar.inactiveBackground": "#45e35f99", + "titleBar.inactiveForeground": "#15202b99" + } +} diff --git a/dbm-ui/frontend/env.d.ts b/dbm-ui/frontend/env.d.ts index 5fc4964bb1..1e46a7a89c 100644 --- a/dbm-ui/frontend/env.d.ts +++ b/dbm-ui/frontend/env.d.ts @@ -58,6 +58,7 @@ declare module '@blueking/notice-component'; declare module '@blueking/login-modal' { export function showLoginModal(params: { loginUrl: string }): void; } +declare module '@blueking/sub-saas'; declare module '@blueking/sub-saas' { export function connectToMain(router: Router): any; diff --git a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg index 75501e08bf..a4dc9f43ab 100644 --- a/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg +++ b/dbm-ui/frontend/lib/bk-icon/fonts/iconcool.svg @@ -7,646 +7,646 @@ - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/dbm-ui/frontend/lib/bk-icon/iconcool.json b/dbm-ui/frontend/lib/bk-icon/iconcool.json index d6afc5cdf1..ced19f2825 100644 --- a/dbm-ui/frontend/lib/bk-icon/iconcool.json +++ b/dbm-ui/frontend/lib/bk-icon/iconcool.json @@ -1 +1 @@ -{"iconName":"bk-dbm","icons":[{"name":"check-circle-fill","svgCode":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n","codepoint":"\\e1a7"},{"name":"exclamation-fill","svgCode":"\n\n\n\n\n\n","codepoint":"\\e173"},{"name":"help","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1f5"},{"name":"help-document","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1fa"},{"name":"auth","svgCode":"","codepoint":"\\e152"},{"name":"apply","svgCode":"","codepoint":"\\e144"},{"name":"increase","svgCode":"","codepoint":"\\e1fb"},{"name":"close-circle-shape","svgCode":"","codepoint":"\\e1be"},{"name":"right-shape","svgCode":"","codepoint":"\\e1a3"},{"name":"bulk-edit","svgCode":"","codepoint":"\\e15f"},{"name":"funnel","svgCode":"","codepoint":"\\e1bd"},{"name":"copy-2","svgCode":"","codepoint":"\\e1e4"},{"name":"paste","svgCode":"","codepoint":"\\e1e5"},{"name":"keyboard","svgCode":"","codepoint":"\\e1ae"},{"name":"draft","svgCode":"","codepoint":"\\e145"},{"name":"todolist","svgCode":"","codepoint":"\\e146"},{"name":"file","svgCode":"","codepoint":"\\e136"},{"name":"script","svgCode":"","codepoint":"\\e137"},{"name":"fast-script","svgCode":"","codepoint":"\\e151"},{"name":"homepage","svgCode":"","codepoint":"\\e158"},{"name":"template","svgCode":"","codepoint":"\\e147"},{"name":"unlock-line","svgCode":"","codepoint":"\\e166"},{"name":"sync-failed","svgCode":"","codepoint":"\\e18c"},{"name":"sync-pending","svgCode":"","codepoint":"\\e18f"},{"name":"sync-success","svgCode":"","codepoint":"\\e18d"},{"name":"sync-default","svgCode":"","codepoint":"\\e18e"},{"name":"pulsar","svgCode":"","codepoint":"\\e1b8"},{"name":"abnormal","svgCode":"","codepoint":"\\e187"},{"name":"normal","svgCode":"","codepoint":"\\e188"},{"name":"unknown","svgCode":"","codepoint":"\\e189"},{"name":"code","svgCode":"","codepoint":"\\e139"},{"name":"download-line","svgCode":"","codepoint":"\\e1f2"},{"name":"variable-manage","svgCode":"","codepoint":"\\e1f7"},{"name":"visible1","svgCode":"","codepoint":"\\e1c5"},{"name":"sync-waiting-01","svgCode":"","codepoint":"\\e18a"},{"name":"script-template","svgCode":"","codepoint":"\\e138"},{"name":"qiyeweixin","svgCode":"","codepoint":"\\e1d9"},{"name":"sql","svgCode":"","codepoint":"\\e1cb"},{"name":"daochu","svgCode":"","codepoint":"\\e1ed"},{"name":"version","svgCode":"","codepoint":"\\e156"},{"name":"copy","svgCode":"","codepoint":"\\e103"},{"name":"database","svgCode":"","codepoint":"\\e101"},{"name":"eyes","svgCode":"","codepoint":"\\e102"},{"name":"setting-fill","svgCode":"","codepoint":"\\e104"},{"name":"resource","svgCode":"","codepoint":"\\e105"},{"name":"ticket","svgCode":"","codepoint":"\\e106"},{"name":"pc","svgCode":"","codepoint":"\\e1e6"},{"name":"edit","svgCode":"","codepoint":"\\e108"},{"name":"loading","svgCode":"","codepoint":"\\e1a8"},{"name":"help-fill","svgCode":"","codepoint":"\\e109"},{"name":"unlock-line-2","svgCode":"","codepoint":"\\e10b"},{"name":"lock-fill","svgCode":"","codepoint":"\\e10c"},{"name":"un-full-screen","svgCode":"","codepoint":"\\e10f"},{"name":"full-screen","svgCode":"","codepoint":"\\e110"},{"name":"minus-fill","svgCode":"","codepoint":"\\e111"},{"name":"plus-fill","svgCode":"","codepoint":"\\e112"},{"name":"add","svgCode":"","codepoint":"\\e116"},{"name":"delete-fill","svgCode":"","codepoint":"\\e117"},{"name":"refresh","svgCode":"","codepoint":"\\e118"},{"name":"more","svgCode":"","codepoint":"\\e119"},{"name":"arrow-fill","svgCode":"","codepoint":"\\e11e"},{"name":"attention-fill","svgCode":"","codepoint":"\\e11f"},{"name":"attention","svgCode":"","codepoint":"\\e120"},{"name":"up-big","svgCode":"","codepoint":"\\e121"},{"name":"down-big","svgCode":"","codepoint":"\\e123"},{"name":"arrow-down","svgCode":"","codepoint":"\\e122"},{"name":"arrow-up","svgCode":"","codepoint":"\\e124"},{"name":"right-big","svgCode":"","codepoint":"\\e125"},{"name":"arrow-right","svgCode":"","codepoint":"\\e126"},{"name":"arrow-left","svgCode":"","codepoint":"\\e127"},{"name":"mysql","svgCode":"","codepoint":"\\e128"},{"name":"redis","svgCode":"","codepoint":"\\e129"},{"name":"mongo-db","svgCode":"","codepoint":"\\e12a"},{"name":"kafka","svgCode":"","codepoint":"\\e12b"},{"name":"approval-node","svgCode":"","codepoint":"\\e155"},{"name":"down-shape","svgCode":"","codepoint":"\\e12c"},{"name":"import","svgCode":"","codepoint":"\\e12d"},{"name":"master","svgCode":"","codepoint":"\\e13a"},{"name":"cluster","svgCode":"","codepoint":"\\e13b"},{"name":"host","svgCode":"","codepoint":"\\e13c"},{"name":"proxy","svgCode":"","codepoint":"\\e13e"},{"name":"node","svgCode":"","codepoint":"\\e13d"},{"name":"check","svgCode":"","codepoint":"\\e13f"},{"name":"deploy","svgCode":"","codepoint":"\\e140"},{"name":"switch","svgCode":"","codepoint":"\\e141"},{"name":"refresh-2","svgCode":"","codepoint":"\\e142"},{"name":"stop","svgCode":"","codepoint":"\\e143"},{"name":"dns","svgCode":"","codepoint":"\\e148"},{"name":"member","svgCode":"","codepoint":"\\e14c"},{"name":"spec","svgCode":"","codepoint":"\\e149"},{"name":"timed-task","svgCode":"","codepoint":"\\e14d"},{"name":"history","svgCode":"","codepoint":"\\e14a"},{"name":"backup","svgCode":"","codepoint":"\\e14f"},{"name":"account","svgCode":"","codepoint":"\\e14b"},{"name":"note","svgCode":"","codepoint":"\\e150"},{"name":"single-node","svgCode":"","codepoint":"\\e14e"},{"name":"dba-config","svgCode":"","codepoint":"\\e154"},{"name":"db-config","svgCode":"","codepoint":"\\e157"},{"name":"default-node","svgCode":"","codepoint":"\\e159"},{"name":"position","svgCode":"","codepoint":"\\e15c"},{"name":"plus-circle","svgCode":"","codepoint":"\\e15d"},{"name":"minus-circle","svgCode":"","codepoint":"\\e15e"},{"name":"rtx","svgCode":"","codepoint":"\\e160"},{"name":"expand-line","svgCode":"","codepoint":"\\e161"},{"name":"star","svgCode":"","codepoint":"\\e162"},{"name":"search","svgCode":"","codepoint":"\\e163"},{"name":"plus-8","svgCode":"","codepoint":"\\e164"},{"name":"star-fill","svgCode":"","codepoint":"\\e165"},{"name":"unlock","svgCode":"","codepoint":"\\e167"},{"name":"return","svgCode":"","codepoint":"\\e168"},{"name":"link","svgCode":"","codepoint":"\\e169"},{"name":"new","svgCode":"","codepoint":"\\e16b"},{"name":"drag","svgCode":"","codepoint":"\\e1a4"},{"name":"warning-2","svgCode":"","codepoint":"\\e18b"},{"name":"exclamation","svgCode":"","codepoint":"\\e16c"},{"name":"close","svgCode":"","codepoint":"\\e16d"},{"name":"check-line","svgCode":"","codepoint":"\\e16e"},{"name":"early-warning","svgCode":"","codepoint":"\\e16f"},{"name":"warning","svgCode":"","codepoint":"\\e170"},{"name":"spce","svgCode":"","codepoint":"\\e171"},{"name":"password","svgCode":"","codepoint":"\\e172"},{"name":"redis-2","svgCode":"","codepoint":"\\e176"},{"name":"mysql-2","svgCode":"","codepoint":"\\e174"},{"name":"es","svgCode":"","codepoint":"\\e177"},{"name":"hdfs","svgCode":"","codepoint":"\\e175"},{"name":"delete","svgCode":"","codepoint":"\\e178"},{"name":"excel","svgCode":"","codepoint":"\\e179"},{"name":"history-2","svgCode":"","codepoint":"\\e17a"},{"name":"migration","svgCode":"","codepoint":"\\e17d"},{"name":"switch-2","svgCode":"","codepoint":"\\e17e"},{"name":"remote","svgCode":"","codepoint":"\\e17f"},{"name":"clearing","svgCode":"","codepoint":"\\e180"},{"name":"alert","svgCode":"","codepoint":"\\e181"},{"name":"rebuild","svgCode":"","codepoint":"\\e182"},{"name":"clone","svgCode":"","codepoint":"\\e183"},{"name":"associated","svgCode":"","codepoint":"\\e184"},{"name":"rollback","svgCode":"","codepoint":"\\e185"},{"name":"aa","svgCode":"","codepoint":"\\e1f6"},{"name":"data","svgCode":"","codepoint":"\\e186"},{"name":"audit","svgCode":"","codepoint":"\\e190"},{"name":"yijinyong","svgCode":"","codepoint":"\\e19a"},{"name":"kuorongzhong","svgCode":"","codepoint":"\\e19d"},{"name":"zhongqizhong","svgCode":"","codepoint":"\\e19b"},{"name":"suorongzhong","svgCode":"","codepoint":"\\e19e"},{"name":"tihuanzong","svgCode":"","codepoint":"\\e19c"},{"name":"shanchuzhong","svgCode":"","codepoint":"\\e19f"},{"name":"jinyongzhong","svgCode":"","codepoint":"\\e1a0"},{"name":"qiyongzhong","svgCode":"","codepoint":"\\e1a1"},{"name":"help-fill-2","svgCode":"","codepoint":"\\e1a2"},{"name":"2-jiantou-you","svgCode":"","codepoint":"\\e1a5"},{"name":"2-jiantou-zuo","svgCode":"","codepoint":"\\e1a6"},{"name":"tools","svgCode":"","codepoint":"\\e1a9"},{"name":"todos","svgCode":"","codepoint":"\\e1aa"},{"name":"manual","svgCode":"","codepoint":"\\e1ac"},{"name":"minimap","svgCode":"","codepoint":"\\e1ad"},{"name":"backup-2","svgCode":"","codepoint":"\\e1af"},{"name":"host-select","svgCode":"","codepoint":"\\e1b0"},{"name":"batch-host-select","svgCode":"","codepoint":"\\e1b1"},{"name":"revoke","svgCode":"","codepoint":"\\e1b3"},{"name":"en","svgCode":"","codepoint":"\\e1b4"},{"name":"cn","svgCode":"","codepoint":"\\e1b5"},{"name":"list","svgCode":"","codepoint":"\\e1b7"},{"name":"influxdb","svgCode":"","codepoint":"\\e1ba"},{"name":"summation","svgCode":"","codepoint":"\\e1bb"},{"name":"folder-open","svgCode":"","codepoint":"\\e1bc"},{"name":"wenjian","svgCode":"","codepoint":"\\e1bf"},{"name":"drag","svgCode":"","codepoint":"\\e1c0"},{"name":"gaokeyong","svgCode":"","codepoint":"\\e1c2"},{"name":"fenbushijiqun","svgCode":"","codepoint":"\\e1c3"},{"name":"danjiedian","svgCode":"","codepoint":"\\e1c1"},{"name":"zhongkongji","svgCode":"","codepoint":"\\e1c4"},{"name":"wenjian","svgCode":"","codepoint":"\\e1c6"},{"name":"manual-2","svgCode":"","codepoint":"\\e1c7"},{"name":"clock","svgCode":"","codepoint":"\\e1c8"},{"name":"auto","svgCode":"","codepoint":"\\e1c9"},{"name":"dirty-host","svgCode":"","codepoint":"\\e1ca"},{"name":"saoba","svgCode":"","codepoint":"\\e1f4"},{"name":"dongzuo-xiazai","svgCode":"","codepoint":"\\e1f3"},{"name":"entry","svgCode":"","codepoint":"\\e1d0"},{"name":"gaojingcelve","svgCode":"","codepoint":"\\e1d1"},{"name":"lunzhi","svgCode":"","codepoint":"\\e1d5"},{"name":"gaojing","svgCode":"","codepoint":"\\e1d2"},{"name":"yonghuzu","svgCode":"","codepoint":"\\e1d3"},{"name":"pingbi","svgCode":"","codepoint":"\\e1d4"},{"name":"hongqi","svgCode":"","codepoint":"\\e1d6"},{"name":"jiankong","svgCode":"","codepoint":"\\e1d7"},{"name":"mimasuijihua","svgCode":"","codepoint":"\\e1d8"},{"name":"jiqiren","svgCode":"","codepoint":"\\e1da"},{"name":"qiyeweixin-2","svgCode":"","codepoint":"\\e1db"},{"name":"weixin-2","svgCode":"","codepoint":"\\e1dc"},{"name":"youjian","svgCode":"","codepoint":"\\e1dd"},{"name":"duanxin","svgCode":"","codepoint":"\\e1de"},{"name":"yuyin","svgCode":"","codepoint":"\\e1df"},{"name":"warn-lightning","svgCode":"","codepoint":"\\e1e1"},{"name":"unlink","svgCode":"","codepoint":"\\e1e2"},{"name":"mobanshili","svgCode":"","codepoint":"\\e1e3"},{"name":"qiangzhizhongzhi","svgCode":"","codepoint":"\\e1e7"},{"name":"sqlserver","svgCode":"","codepoint":"\\e1e8"},{"name":"qianyizhong","svgCode":"","codepoint":"\\e1ea"},{"name":"liucheng","svgCode":"","codepoint":"\\e1eb"},{"name":"kejian","svgCode":"","codepoint":"\\e1ec"},{"name":"doris","svgCode":"","codepoint":"\\e1ee"},{"name":"daochu-2","svgCode":"","codepoint":"\\e1f0"},{"name":"daoru","svgCode":"","codepoint":"\\e1ef"},{"name":"piliangluru","svgCode":"","codepoint":"\\e1f1"},{"name":"cluster-standardize","svgCode":"","codepoint":"\\e1f9"}]} \ No newline at end of file +{"iconName":"bk-dbm","icons":[{"name":"check-circle-fill","svgCode":"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n\n\n\n\n\n\n\n\n\n\n\n\n","codepoint":"\\e1a7"},{"name":"exclamation-fill","svgCode":"\n\n\n\n\n\n","codepoint":"\\e173"},{"name":"help","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1f5"},{"name":"help-document","svgCode":"\n\n\n\n\n\t\n\t\n\t\n\n\n","codepoint":"\\e1fa"},{"name":"auth","svgCode":"","codepoint":"\\e152"},{"name":"apply","svgCode":"","codepoint":"\\e144"},{"name":"increase","svgCode":"","codepoint":"\\e1fb"},{"name":"close-circle-shape","svgCode":"","codepoint":"\\e1be"},{"name":"right-shape","svgCode":"","codepoint":"\\e1a3"},{"name":"bulk-edit","svgCode":"","codepoint":"\\e15f"},{"name":"funnel","svgCode":"","codepoint":"\\e1bd"},{"name":"copy-2","svgCode":"","codepoint":"\\e1e4"},{"name":"paste","svgCode":"","codepoint":"\\e1e5"},{"name":"keyboard","svgCode":"","codepoint":"\\e1ae"},{"name":"draft","svgCode":"","codepoint":"\\e145"},{"name":"todolist","svgCode":"","codepoint":"\\e146"},{"name":"file","svgCode":"","codepoint":"\\e136"},{"name":"script","svgCode":"","codepoint":"\\e137"},{"name":"fast-script","svgCode":"","codepoint":"\\e151"},{"name":"homepage","svgCode":"","codepoint":"\\e158"},{"name":"template","svgCode":"","codepoint":"\\e147"},{"name":"unlock-line","svgCode":"","codepoint":"\\e166"},{"name":"sync-failed","svgCode":"","codepoint":"\\e18c"},{"name":"sync-pending","svgCode":"","codepoint":"\\e18f"},{"name":"sync-success","svgCode":"","codepoint":"\\e18d"},{"name":"sync-default","svgCode":"","codepoint":"\\e18e"},{"name":"pulsar","svgCode":"","codepoint":"\\e1b8"},{"name":"abnormal","svgCode":"","codepoint":"\\e187"},{"name":"normal","svgCode":"","codepoint":"\\e188"},{"name":"unknown","svgCode":"","codepoint":"\\e189"},{"name":"code","svgCode":"","codepoint":"\\e139"},{"name":"download-line","svgCode":"","codepoint":"\\e1f2"},{"name":"variable-manage","svgCode":"","codepoint":"\\e1f7"},{"name":"visible1","svgCode":"","codepoint":"\\e1c5"},{"name":"sync-waiting-01","svgCode":"","codepoint":"\\e18a"},{"name":"script-template","svgCode":"","codepoint":"\\e138"},{"name":"qiyeweixin","svgCode":"","codepoint":"\\e1d9"},{"name":"sql","svgCode":"","codepoint":"\\e1cb"},{"name":"daochu","svgCode":"","codepoint":"\\e1ed"},{"name":"version","svgCode":"","codepoint":"\\e156"},{"name":"copy","svgCode":"","codepoint":"\\e103"},{"name":"database","svgCode":"","codepoint":"\\e101"},{"name":"eyes","svgCode":"","codepoint":"\\e102"},{"name":"setting-fill","svgCode":"","codepoint":"\\e104"},{"name":"resource","svgCode":"","codepoint":"\\e105"},{"name":"ticket","svgCode":"","codepoint":"\\e106"},{"name":"pc","svgCode":"","codepoint":"\\e1e6"},{"name":"edit","svgCode":"","codepoint":"\\e108"},{"name":"loading","svgCode":"","codepoint":"\\e1a8"},{"name":"help-fill","svgCode":"","codepoint":"\\e109"},{"name":"unlock-line-2","svgCode":"","codepoint":"\\e10b"},{"name":"lock-fill","svgCode":"","codepoint":"\\e10c"},{"name":"un-full-screen","svgCode":"","codepoint":"\\e10f"},{"name":"full-screen","svgCode":"","codepoint":"\\e110"},{"name":"minus-fill","svgCode":"","codepoint":"\\e111"},{"name":"plus-fill","svgCode":"","codepoint":"\\e112"},{"name":"add","svgCode":"","codepoint":"\\e116"},{"name":"delete-fill","svgCode":"","codepoint":"\\e117"},{"name":"refresh","svgCode":"","codepoint":"\\e118"},{"name":"more","svgCode":"","codepoint":"\\e119"},{"name":"arrow-fill","svgCode":"","codepoint":"\\e11e"},{"name":"attention-fill","svgCode":"","codepoint":"\\e11f"},{"name":"attention","svgCode":"","codepoint":"\\e120"},{"name":"up-big","svgCode":"","codepoint":"\\e121"},{"name":"down-big","svgCode":"","codepoint":"\\e123"},{"name":"arrow-down","svgCode":"","codepoint":"\\e122"},{"name":"arrow-up","svgCode":"","codepoint":"\\e124"},{"name":"right-big","svgCode":"","codepoint":"\\e125"},{"name":"arrow-right","svgCode":"","codepoint":"\\e126"},{"name":"arrow-left","svgCode":"","codepoint":"\\e127"},{"name":"mysql","svgCode":"","codepoint":"\\e128"},{"name":"redis","svgCode":"","codepoint":"\\e129"},{"name":"mongo-db","svgCode":"","codepoint":"\\e12a"},{"name":"kafka","svgCode":"","codepoint":"\\e12b"},{"name":"approval-node","svgCode":"","codepoint":"\\e155"},{"name":"down-shape","svgCode":"","codepoint":"\\e12c"},{"name":"import","svgCode":"","codepoint":"\\e12d"},{"name":"master","svgCode":"","codepoint":"\\e13a"},{"name":"cluster","svgCode":"","codepoint":"\\e13b"},{"name":"host","svgCode":"","codepoint":"\\e13c"},{"name":"proxy","svgCode":"","codepoint":"\\e13e"},{"name":"node","svgCode":"","codepoint":"\\e13d"},{"name":"check","svgCode":"","codepoint":"\\e13f"},{"name":"deploy","svgCode":"","codepoint":"\\e140"},{"name":"switch","svgCode":"","codepoint":"\\e141"},{"name":"refresh-2","svgCode":"","codepoint":"\\e142"},{"name":"stop","svgCode":"","codepoint":"\\e143"},{"name":"dns","svgCode":"","codepoint":"\\e148"},{"name":"member","svgCode":"","codepoint":"\\e14c"},{"name":"spec","svgCode":"","codepoint":"\\e149"},{"name":"timed-task","svgCode":"","codepoint":"\\e14d"},{"name":"history","svgCode":"","codepoint":"\\e14a"},{"name":"backup","svgCode":"","codepoint":"\\e14f"},{"name":"account","svgCode":"","codepoint":"\\e14b"},{"name":"note","svgCode":"","codepoint":"\\e150"},{"name":"single-node","svgCode":"","codepoint":"\\e14e"},{"name":"dba-config","svgCode":"","codepoint":"\\e154"},{"name":"db-config","svgCode":"","codepoint":"\\e157"},{"name":"default-node","svgCode":"","codepoint":"\\e159"},{"name":"position","svgCode":"","codepoint":"\\e15c"},{"name":"plus-circle","svgCode":"","codepoint":"\\e15d"},{"name":"minus-circle","svgCode":"","codepoint":"\\e15e"},{"name":"rtx","svgCode":"","codepoint":"\\e160"},{"name":"expand-line","svgCode":"","codepoint":"\\e161"},{"name":"star","svgCode":"","codepoint":"\\e162"},{"name":"search","svgCode":"","codepoint":"\\e163"},{"name":"plus-8","svgCode":"","codepoint":"\\e164"},{"name":"star-fill","svgCode":"","codepoint":"\\e165"},{"name":"unlock","svgCode":"","codepoint":"\\e167"},{"name":"return","svgCode":"","codepoint":"\\e168"},{"name":"link","svgCode":"","codepoint":"\\e169"},{"name":"new","svgCode":"","codepoint":"\\e16b"},{"name":"drag","svgCode":"","codepoint":"\\e1a4"},{"name":"warning-2","svgCode":"","codepoint":"\\e18b"},{"name":"exclamation","svgCode":"","codepoint":"\\e16c"},{"name":"close","svgCode":"","codepoint":"\\e16d"},{"name":"check-line","svgCode":"","codepoint":"\\e16e"},{"name":"early-warning","svgCode":"","codepoint":"\\e16f"},{"name":"warning","svgCode":"","codepoint":"\\e170"},{"name":"spce","svgCode":"","codepoint":"\\e171"},{"name":"password","svgCode":"","codepoint":"\\e172"},{"name":"redis-2","svgCode":"","codepoint":"\\e176"},{"name":"mysql-2","svgCode":"","codepoint":"\\e174"},{"name":"es","svgCode":"","codepoint":"\\e177"},{"name":"hdfs","svgCode":"","codepoint":"\\e175"},{"name":"delete","svgCode":"","codepoint":"\\e178"},{"name":"excel","svgCode":"","codepoint":"\\e179"},{"name":"history-2","svgCode":"","codepoint":"\\e17a"},{"name":"migration","svgCode":"","codepoint":"\\e17d"},{"name":"switch-2","svgCode":"","codepoint":"\\e17e"},{"name":"remote","svgCode":"","codepoint":"\\e17f"},{"name":"clearing","svgCode":"","codepoint":"\\e180"},{"name":"alert","svgCode":"","codepoint":"\\e181"},{"name":"rebuild","svgCode":"","codepoint":"\\e182"},{"name":"clone","svgCode":"","codepoint":"\\e183"},{"name":"associated","svgCode":"","codepoint":"\\e184"},{"name":"rollback","svgCode":"","codepoint":"\\e185"},{"name":"aa","svgCode":"","codepoint":"\\e1f6"},{"name":"data","svgCode":"","codepoint":"\\e186"},{"name":"audit","svgCode":"","codepoint":"\\e190"},{"name":"yijinyong","svgCode":"","codepoint":"\\e19a"},{"name":"kuorongzhong","svgCode":"","codepoint":"\\e19d"},{"name":"zhongqizhong","svgCode":"","codepoint":"\\e19b"},{"name":"suorongzhong","svgCode":"","codepoint":"\\e19e"},{"name":"tihuanzong","svgCode":"","codepoint":"\\e19c"},{"name":"shanchuzhong","svgCode":"","codepoint":"\\e19f"},{"name":"jinyongzhong","svgCode":"","codepoint":"\\e1a0"},{"name":"qiyongzhong","svgCode":"","codepoint":"\\e1a1"},{"name":"help-fill-2","svgCode":"","codepoint":"\\e1a2"},{"name":"2-jiantou-you","svgCode":"","codepoint":"\\e1a5"},{"name":"2-jiantou-zuo","svgCode":"","codepoint":"\\e1a6"},{"name":"tools","svgCode":"","codepoint":"\\e1a9"},{"name":"todos","svgCode":"","codepoint":"\\e1aa"},{"name":"manual","svgCode":"","codepoint":"\\e1ac"},{"name":"minimap","svgCode":"","codepoint":"\\e1ad"},{"name":"backup-2","svgCode":"","codepoint":"\\e1af"},{"name":"host-select","svgCode":"","codepoint":"\\e1b0"},{"name":"batch-host-select","svgCode":"","codepoint":"\\e1b1"},{"name":"revoke","svgCode":"","codepoint":"\\e1b3"},{"name":"en","svgCode":"","codepoint":"\\e1b4"},{"name":"cn","svgCode":"","codepoint":"\\e1b5"},{"name":"list","svgCode":"","codepoint":"\\e1b7"},{"name":"influxdb","svgCode":"","codepoint":"\\e1ba"},{"name":"summation","svgCode":"","codepoint":"\\e1bb"},{"name":"folder-open","svgCode":"","codepoint":"\\e1bc"},{"name":"wenjian","svgCode":"","codepoint":"\\e1bf"},{"name":"drag","svgCode":"","codepoint":"\\e1c0"},{"name":"gaokeyong","svgCode":"","codepoint":"\\e1c2"},{"name":"fenbushijiqun","svgCode":"","codepoint":"\\e1c3"},{"name":"danjiedian","svgCode":"","codepoint":"\\e1c1"},{"name":"zhongkongji","svgCode":"","codepoint":"\\e1c4"},{"name":"wenjian","svgCode":"","codepoint":"\\e1c6"},{"name":"manual-2","svgCode":"","codepoint":"\\e1c7"},{"name":"clock","svgCode":"","codepoint":"\\e1c8"},{"name":"auto","svgCode":"","codepoint":"\\e1c9"},{"name":"dirty-host","svgCode":"","codepoint":"\\e1ca"},{"name":"saoba","svgCode":"","codepoint":"\\e1f4"},{"name":"dongzuo-xiazai","svgCode":"","codepoint":"\\e1f3"},{"name":"entry","svgCode":"","codepoint":"\\e1d0"},{"name":"gaojingcelve","svgCode":"","codepoint":"\\e1d1"},{"name":"lunzhi","svgCode":"","codepoint":"\\e1d5"},{"name":"gaojing","svgCode":"","codepoint":"\\e1d2"},{"name":"yonghuzu","svgCode":"","codepoint":"\\e1d3"},{"name":"pingbi","svgCode":"","codepoint":"\\e1d4"},{"name":"hongqi","svgCode":"","codepoint":"\\e1d6"},{"name":"jiankong","svgCode":"","codepoint":"\\e1d7"},{"name":"mimasuijihua","svgCode":"","codepoint":"\\e1d8"},{"name":"jiqiren","svgCode":"","codepoint":"\\e1da"},{"name":"qiyeweixin-2","svgCode":"","codepoint":"\\e1db"},{"name":"weixin-2","svgCode":"","codepoint":"\\e1dc"},{"name":"youjian","svgCode":"","codepoint":"\\e1dd"},{"name":"duanxin","svgCode":"","codepoint":"\\e1de"},{"name":"yuyin","svgCode":"","codepoint":"\\e1df"},{"name":"warn-lightning","svgCode":"","codepoint":"\\e1e1"},{"name":"unlink","svgCode":"","codepoint":"\\e1e2"},{"name":"mobanshili","svgCode":"","codepoint":"\\e1e3"},{"name":"qiangzhizhongzhi","svgCode":"","codepoint":"\\e1e7"},{"name":"sqlserver","svgCode":"","codepoint":"\\e1e8"},{"name":"qianyizhong","svgCode":"","codepoint":"\\e1ea"},{"name":"liucheng","svgCode":"","codepoint":"\\e1eb"},{"name":"kejian","svgCode":"","codepoint":"\\e1ec"},{"name":"doris","svgCode":"","codepoint":"\\e1ee"},{"name":"daochu-2","svgCode":"","codepoint":"\\e1f0"},{"name":"daoru","svgCode":"","codepoint":"\\e1ef"},{"name":"piliangluru","svgCode":"","codepoint":"\\e1f1"},{"name":"cluster-standardize","svgCode":"","codepoint":"\\e1f9"}]} diff --git a/dbm-ui/frontend/lib/bk-icon/style.css b/dbm-ui/frontend/lib/bk-icon/style.css index 4983c17784..96294239a4 100644 --- a/dbm-ui/frontend/lib/bk-icon/style.css +++ b/dbm-ui/frontend/lib/bk-icon/style.css @@ -635,9 +635,12 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype"); .db-icon-daoru:before { content: "\e1ef"; } +<<<<<<< HEAD .db-icon-piliangluru:before { content: "\e1f1"; } .db-icon-cluster-standardize:before { content: "\e1f9"; } +======= +>>>>>>> 3155ff4ed (feat(frontend): sqlserver 工具箱 #3485) diff --git a/dbm-ui/frontend/package.json b/dbm-ui/frontend/package.json index 36cd9223db..b796f9176f 100644 --- a/dbm-ui/frontend/package.json +++ b/dbm-ui/frontend/package.json @@ -18,8 +18,8 @@ "dependencies": { "@blueking/app-select": "0.0.1-beta.12", "@blueking/bk-weweb": "0.0.24", - "@blueking/bkflow.js": "0.1.10", - "@blueking/date-picker": "0.0.72", + "@blueking/bkflow.js": "0.1.11", + "@blueking/date-picker": "^1.0.1", "@blueking/ip-selector": "0.3.0-beta.23", "@blueking/notice-component": "2.0.5", "@blueking/sub-saas": "^0.0.0-beta.6", @@ -27,72 +27,73 @@ "@icon-cool/bk-icon-bk-biz-components": "0.0.4", "@vueuse/core": "10.9.0", "axios": "1.6.8", - "bkui-vue": "2.0.1-beta.19", - "date-fns": "3.0.4", + "bkui-vue": "2.0.1-beta.31", + "date-fns": "3.6.0", "dayjs": "1.11.10", "html-to-image": "1.11.11", "js-cookie": "3.0.5", "jsencrypt": "3.3.2", "lodash": "4.17.21", "mitt": "3.0.1", - "monaco-editor": "0.46.0", + "monaco-editor": "0.48.0", "pinia": "2.1.7", - "qs": "6.11.2", + "qs": "6.12.1", "screenfull": "6.0.2", "tiny-pinyin": "1.3.2", "tippy.js": "6.3.7", - "unplugin-auto-import": "0.17.2", "url-join": "5.0.0", - "vite-plugin-monaco-editor": "1.1.0", - "vite-plugin-static-copy": "1.0.0", - "vue": "3.4.15", + "vue": "^3.4.27", "vue-content-loader": "2.0.1", - "vue-i18n": "9.6.5", + "vue-i18n": "^9.13.1", "vue-request": "2.0.4", - "vue-router": "4.2.5", + "vue-router": "^4.3.2", + "vue-types": "^5.1.2", "vuedraggable": "4.1.0", "xlsx": "0.18.5" }, "devDependencies": { - "@commitlint/config-conventional": "19.0.0", + "@commitlint/config-conventional": "^19.2.2", "@trivago/prettier-plugin-sort-imports": "4.3.0", - "@types/lodash": "4.14.202", - "@types/node": "20.11.21", - "@types/qs": "6.9.12", - "@vitejs/plugin-basic-ssl": "1.0.2", + "@tsconfig/node20": "20.1.4", + "@types/lodash": "4.17.0", + "@types/node": "^20.12.10", + "@types/qs": "^6.9.15", + "@vitejs/plugin-basic-ssl": "1.1.0", "@vitejs/plugin-vue": "5.0.4", "@vitejs/plugin-vue-jsx": "3.1.0", - "@vue/eslint-config-typescript": "12.0.0", + "@vue/eslint-config-typescript": "13.0.0", "@vue/tsconfig": "0.5.1", - "commitlint": "19.0.1", + "commitlint": "^19.3.0", "cross-env": "7.0.3", - "eslint": "8.56.0", + "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-tencent": "1.0.4", - "eslint-plugin-prettier": "5.1.3", - "eslint-plugin-simple-import-sort": "12.0.0", - "eslint-plugin-vue": "9.18.1", + "eslint-plugin-simple-import-sort": "12.1.0", + "eslint-plugin-vue": "^9.25.0", "less": "4.2.0", - "lint-staged": "15.0.2", + "lint-staged": "15.2.2", "npm-run-all2": "6.1.2", - "postcss-html": "1.5.0", + "postcss-html": "1.6.0", "postcss-less": "6.0.0", "prettier": "3.2.5", - "prettier-plugin-curly": "0.1.4", - "simple-git-hooks": "2.9.0", - "stylelint": "16.2.1", + "prettier-plugin-curly": "0.2.1", + "simple-git-hooks": "2.11.0", + "stylelint": "16.5.0", "stylelint-config-standard": "36.0.0", "stylelint-less": "3.0.1", "stylelint-order": "6.0.4", - "typescript": "5.3.2", - "unplugin-vue-components": "0.26.0", - "vite": "5.0.10", + "typescript": "5.4.5", + "unplugin-auto-import": "0.17.5", + "unplugin-vue-components": "0.27.0", + "vite": "^5.2.11", "vite-plugin-babel": "1.2.0", "vite-plugin-html-env": "1.2.8", "vite-plugin-imp": "2.4.0", + "vite-plugin-monaco-editor": "1.1.0", + "vite-plugin-static-copy": "^1.0.4", "vite-plugin-style-import": "2.0.0", "vue-component-type-helpers": "2.0.6", - "vue-tsc": "1.8.22" + "vue-tsc": "2.0.16" }, "simple-git-hooks": { "pre-commit": "cd dbm-ui/frontend && npx lint-staged", diff --git a/dbm-ui/frontend/src/components/cluster-authorize/ClusterAuthorize.vue b/dbm-ui/frontend/src/components/cluster-authorize/ClusterAuthorize.vue index c2356c2d7f..dfa1e57814 100644 --- a/dbm-ui/frontend/src/components/cluster-authorize/ClusterAuthorize.vue +++ b/dbm-ui/frontend/src/components/cluster-authorize/ClusterAuthorize.vue @@ -221,10 +221,6 @@ import AccountRulesTable from './accouter-rules-selector/components/AccountRulesTable.vue'; import AccountRulesSelector from './accouter-rules-selector/Index.vue'; - - export default { - name: 'ClusterAuthorize', - }; 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/sql-server/table/Index.vue new file mode 100644 index 0000000000..7664ce600c --- /dev/null +++ b/dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/Index.vue @@ -0,0 +1,361 @@ + + + + + + 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/sql-server/table/useTableData.ts new file mode 100644 index 0000000000..631b6ea74a --- /dev/null +++ b/dbm-ui/frontend/src/components/instance-selector/components/sql-server/table/useTableData.ts @@ -0,0 +1,108 @@ +/* + * 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 type { ISearchValue } from 'bkui-vue/lib/search-select/utils'; +import type { ComponentInternalInstance, Ref } from 'vue'; + +import { useGlobalBizs } from '@stores'; + +import { getSearchSelectorParams } from '@utils'; + +/** + * 处理集群列表数据 + */ +export function useTableData( + searchSelectValue: Ref, + role?: Ref, + clusterId?: Ref, +) { + const { currentBizId } = useGlobalBizs(); + const currentInstance = getCurrentInstance() as ComponentInternalInstance & { + proxy: { + getTableList: (params: any) => Promise; + }; + }; + + const isLoading = ref(false); + const tableData = shallowRef([]); + const isAnomalies = ref(false); + const pagination = reactive({ + count: 0, + current: 1, + limit: 10, + limitList: [10, 20, 50, 100], + align: 'right', + layout: ['total', 'limit', 'list'], + }); + + watch(searchSelectValue, () => { + setTimeout(() => { + handleChangePage(1); + }); + }); + + const fetchResources = async () => { + isLoading.value = true; + const params = { + bk_biz_id: currentBizId, + limit: pagination.limit, + offset: (pagination.current - 1) * pagination.limit, + extra: 1, + ...getSearchSelectorParams(searchSelectValue.value), + }; + if (role?.value) { + Object.assign(params, { + role: role.value, + }); + } + if (clusterId?.value && clusterId.value !== currentBizId) { + Object.assign(params, { + cluster_id: clusterId.value, + }); + } + return currentInstance.proxy + .getTableList(params) + .then((data) => { + const ret = data; + tableData.value = ret.results; + pagination.count = ret.count; + isAnomalies.value = false; + }) + .catch(() => { + tableData.value = []; + pagination.count = 0; + isAnomalies.value = true; + }) + .finally(() => { + isLoading.value = false; + }); + }; + + const handleChangePage = (value: number) => { + pagination.current = value; + return fetchResources(); + }; + + const handeChangeLimit = (value: number) => { + pagination.limit = value; + return handleChangePage(1); + }; + + return { + isLoading, + data: tableData, + pagination, + fetchResources, + handleChangePage, + handeChangeLimit, + }; +} diff --git a/dbm-ui/frontend/src/components/instance-selector/components/sql-server/useTopoData.ts b/dbm-ui/frontend/src/components/instance-selector/components/sql-server/useTopoData.ts new file mode 100644 index 0000000000..37fae1ab28 --- /dev/null +++ b/dbm-ui/frontend/src/components/instance-selector/components/sql-server/useTopoData.ts @@ -0,0 +1,112 @@ +/* + * 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 type { ComponentInternalInstance, ComputedRef } from 'vue'; + +import { useGlobalBizs } from '@stores'; + +import { activePanelInjectionKey } from '../../Index.vue'; + +interface TopoTreeData { + id: number; + name: string; + obj: 'biz' | 'cluster'; + count: number; + children: Array; +} + +/** + * 处理集群列表数据 + */ +export function useTopoData>(filterClusterId: ComputedRef) { + const { currentBizId, currentBizInfo } = useGlobalBizs(); + const currentInstance = getCurrentInstance() as ComponentInternalInstance & { + proxy: { + getTopoList: (params: any) => Promise; + countFunc?: (data: T) => number; + }; + }; + + const activePanel = inject(activePanelInjectionKey); + + const isLoading = ref(false); + const selectClusterId = ref(); + const treeRef = ref(); + + const treeData = shallowRef([]); + + /** + * 获取列表 + */ + const fetchResources = async () => { + isLoading.value = true; + const params = { + bk_biz_id: currentBizId, + cluster_filters: [ + { + bk_biz_id: currentBizId, + cluster_type: activePanel?.value, + }, + ], + } as Record; + if (filterClusterId.value) { + params.cluster_filters[0].id = filterClusterId.value; + } + return currentInstance.proxy + .getTopoList(params) + .then((data) => { + const countFn = currentInstance.proxy?.countFunc; + const formatData = data.map((item: T) => ({ ...item, count: countFn ? countFn(item) : item.remote_db.length })); + const children = formatData.map((item: T) => ({ + id: item.id, + name: item.master_domain || '--', + obj: 'cluster', + count: item.count, + children: [], + })); + + treeData.value = filterClusterId.value + ? children + : [ + { + name: currentBizInfo?.display_name || '--', + id: currentBizId, + obj: 'biz', + count: formatData.reduce((count: number, item: any) => count + item.count, 0), + children, + }, + ]; + + setTimeout(() => { + if (data.length > 0) { + console.log('treeData.value = ', treeData.value); + const [firstNode] = treeData.value; + selectClusterId.value = firstNode.id; + const [firstRawNode] = treeRef.value.getData().data; + treeRef.value.setOpen(firstRawNode); + treeRef.value.setSelect(firstRawNode); + } + }); + }) + .finally(() => { + isLoading.value = false; + }); + }; + + return { + treeRef, + isLoading, + treeData, + selectClusterId, + fetchResources, + }; +} diff --git a/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster-host/table/useTableData.ts b/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster-host/table/useTableData.ts index 98fd037946..8450a3f55a 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster-host/table/useTableData.ts +++ b/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster-host/table/useTableData.ts @@ -11,7 +11,7 @@ * the specific language governing permissions and limitations under the License. */ -import { type ComponentInternalInstance } from 'vue'; +import type { ComponentInternalInstance, Ref } from 'vue'; import { useGlobalBizs } from '@stores'; diff --git a/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster/table/useTableData.ts b/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster/table/useTableData.ts index 638a076f08..631b6ea74a 100644 --- a/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster/table/useTableData.ts +++ b/dbm-ui/frontend/src/components/instance-selector/components/tendb-cluster/table/useTableData.ts @@ -9,9 +9,9 @@ * 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 type { ISearchValue } from 'bkui-vue/lib/search-select/utils'; -import { type ComponentInternalInstance } from 'vue'; +import type { ComponentInternalInstance, Ref } from 'vue'; import { useGlobalBizs } from '@stores'; diff --git a/dbm-ui/frontend/src/components/render-table/Index.vue b/dbm-ui/frontend/src/components/render-table/Index.vue index 8ea76882ba..626a88df64 100644 --- a/dbm-ui/frontend/src/components/render-table/Index.vue +++ b/dbm-ui/frontend/src/components/render-table/Index.vue @@ -24,6 +24,11 @@ +
+ +
@@ -41,6 +46,12 @@ import useColumnResize from './hooks/useColumnResize'; + const slots = defineSlots<{ + default(): any; + data(): any; + empty?(): any; + }>(); + const checkTableScroll = () => { // handleScroll(); rowWidth.value = tableRef.value.clientWidth; @@ -150,5 +161,11 @@ width: 1px; background: #dfe0e5; } + + .toolbox-table-empty { + display: flex; + justify-content: center; + align-items: center; + } } diff --git a/dbm-ui/frontend/src/components/render-table/columns/element/Index.vue b/dbm-ui/frontend/src/components/render-table/columns/element/Index.vue new file mode 100644 index 0000000000..3f5375054c --- /dev/null +++ b/dbm-ui/frontend/src/components/render-table/columns/element/Index.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/dbm-ui/frontend/src/components/render-table/columns/input/index.vue b/dbm-ui/frontend/src/components/render-table/columns/input/index.vue index b681883ff4..3f41ea93d9 100644 --- a/dbm-ui/frontend/src/components/render-table/columns/input/index.vue +++ b/dbm-ui/frontend/src/components/render-table/columns/input/index.vue @@ -54,22 +54,24 @@ import useValidtor, { type Rules } from '../../hooks/useValidtor'; interface Props { - placeholder?: string, - rules?: Rules, - disabled?: boolean, - type?: string, - min?: number, - max?: number, - isShowBlur?: boolean, + placeholder?: string; + rules?: Rules; + disabled?: boolean; + type?: string; + min?: number; + max?: number; + isShowBlur?: boolean; } interface Emits { - (e: 'submit', value: string): void, + (e: 'submit', value: string): void; + (e: 'error', result: boolean): void; } interface Exposes { - getValue: () => Promise, - focus: () => void, + getValue: () => Promise; + validator: () => Promise; + focus: () => void; } const props = withDefaults(defineProps(), { @@ -93,18 +95,21 @@ const isPassword = computed(() => props.type === 'password'); - let oldInputText = '' + let oldInputText = ''; - const { - message: errorMessage, - validator, - } = useValidtor(props.rules); + const { message: errorMessage, validator } = useValidtor(props.rules); - watch(modelValue, (value) => { - if (value) { - window.changeConfirm = true; - } - }); + watch( + modelValue, + (value) => { + if (value) { + window.changeConfirm = true; + } + }, + { + immediate: true, + }, + ); // 响应输入 const handleInput = (value: string) => { @@ -128,8 +133,10 @@ validator(modelValue.value) .then(() => { window.changeConfirm = true; + emits('error', false); emits('submit', modelValue.value); - }); + }) + .catch(() => emits('error', true)); return; } emits('submit', modelValue.value); @@ -155,9 +162,11 @@ .then((result) => { if (result) { window.changeConfirm = true; + emits('error', false); emits('submit', modelValue.value); } - }); + }) + .catch(() => emits('error', true)); } }; @@ -174,6 +183,12 @@ getValue() { return validator(modelValue.value).then(() => modelValue.value); }, + validator() { + return validator(modelValue.value).then( + () => true, + () => false, + ); + }, focus() { (rootRef.value as HTMLElement).querySelector('input')?.focus(); }, diff --git a/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue b/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue index a1c9fa5214..db28ba7fb4 100644 --- a/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue +++ b/dbm-ui/frontend/src/components/render-table/columns/tag-input/index.vue @@ -14,12 +14,12 @@ \ No newline at end of file + diff --git a/dbm-ui/frontend/src/hooks/useFullscreenStyle.ts b/dbm-ui/frontend/src/hooks/useFullscreenStyle.ts index 989e221275..22f5dec0ad 100644 --- a/dbm-ui/frontend/src/hooks/useFullscreenStyle.ts +++ b/dbm-ui/frontend/src/hooks/useFullscreenStyle.ts @@ -25,13 +25,11 @@ export const useFullscreenStyle = (elementRef: Ref) => }, ), ); - observer.observe(document.body, { subtree: true, childList: true, attributes: true, }); - onBeforeUnmount(() => { observer.takeRecords(); observer.disconnect(); diff --git a/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx b/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx index 190a6845a9..c981ca27e2 100644 --- a/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx +++ b/dbm-ui/frontend/src/hooks/useSQLTaskNotify.tsx @@ -44,6 +44,7 @@ export const useSQLTaskNotify = () => { }, ], pollingInterval: 10000, + debounceInterval: 10000, onSuccess(data) { const isAlterItem = _.find(data, (item) => item.is_alter); diff --git a/dbm-ui/frontend/src/layout/Index.vue b/dbm-ui/frontend/src/layout/Index.vue index 3ccd9e1c0a..64446dbe30 100644 --- a/dbm-ui/frontend/src/layout/Index.vue +++ b/dbm-ui/frontend/src/layout/Index.vue @@ -232,6 +232,7 @@ .navigation-nav { z-index: 1001 !important; + .split-line { margin: 0 20px 0 60px; border-bottom: solid #29344c 1px; diff --git a/dbm-ui/frontend/src/layout/components/database-manage/components/module-group/SqlServer.vue b/dbm-ui/frontend/src/layout/components/database-manage/components/module-group/SqlServer.vue index 57168dbd88..43883707f9 100644 --- a/dbm-ui/frontend/src/layout/components/database-manage/components/module-group/SqlServer.vue +++ b/dbm-ui/frontend/src/layout/components/database-manage/components/module-group/SqlServer.vue @@ -46,21 +46,63 @@ - - - - {{ t('数据库备份') }} - - + + + + + + {{ t('工具箱') }} + + + diff --git a/dbm-ui/frontend/src/locales/zh-cn.json b/dbm-ui/frontend/src/locales/zh-cn.json index ee887aff2d..8eae3ce56d 100644 --- a/dbm-ui/frontend/src/locales/zh-cn.json +++ b/dbm-ui/frontend/src/locales/zh-cn.json @@ -2984,7 +2984,6 @@ "ip数不能超过n个": "ip数不能超过 {n} 个", "部分IP不存在": "部分IP不存在", "备份时间": "备份时间", - "重置将会情况当前填写的所有内容_请谨慎操作": "重置将会情况当前填写的所有内容,请谨慎操作", "选择主机": "选择主机", "申请 Redis 主从部署": "申请 Redis 主从部署", "版本升级": "版本升级", @@ -2997,8 +2996,6 @@ "确定保存并执行?": "确定保存并执行?", "撤销单据": "撤销单据", "再次提单": "再次提单", - "分片数": "分片数", - "全局配置": "全局配置", "添加": "添加", "更多": "更多", "共执行": "共执行", @@ -3006,7 +3003,6 @@ "业务名称": "业务名称", "业务ID": "业务ID", "%:匹配任意长度字符串,如 a%": "%:匹配任意长度字符串,如 a%", - "数据迁移": "数据迁移", "迁移DB名 ": "迁移DB名 ", "最终DB名": "最终DB名", "数据迁移:数据同步复制到新集群,迁移后将会对原库进行": "数据迁移:数据同步复制到新集群,迁移后将会对原库进行", @@ -3130,6 +3126,22 @@ "数据和表结构": "数据和表结构", "数据": "数据", "下载结果文件": "下载结果文件", - "请输入 where 条件,如:userId > 10000,不要带where关键字": "请输入 where 条件,如:userId > 10000,不要带where关键字", + "全局配置": "全局配置", + "分片数": "分片数", + "SQlServer_工具箱": "SQlServer 工具箱", + "数据迁移": "数据迁移", + "迁移记录": "迁移记录", + "重置将会情况当前填写的所有内容_请谨慎操作": "重置将会情况当前填写的所有内容_请谨慎操作", + "最终 DB": "最终 DB", + "清理表数据": "清理表数据", + "删除表": "删除表", + "删除整库": "删除整库", + "构造后 DB 名不能为空": "构造后 DB 名不能为空", + "构造后 DB 名待有冲突更新": "构造后 DB 名待有冲突更新", + "请先设置集群、构造 DB": "请先设置集群、构造 DB", + "迁移类型": "迁移类型", + "迁移 DB": "迁移 DB", + "数据迁移:数据同步复制到新集群": "数据迁移:数据同步复制到新集群", + "(共 n 个)": "(共 {0} 个)", "这行勿动!新增翻译请在上一行添加!": "" } diff --git a/dbm-ui/frontend/src/services/http/lib/request.ts b/dbm-ui/frontend/src/services/http/lib/request.ts index fe6c11bfae..0b98c0f004 100644 --- a/dbm-ui/frontend/src/services/http/lib/request.ts +++ b/dbm-ui/frontend/src/services/http/lib/request.ts @@ -9,12 +9,9 @@ * 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 axios, { - type AxiosRequestConfig, - type CancelTokenSource, -} from 'axios'; +import axios, { type AxiosRequestConfig, type CancelTokenSource } from 'axios'; import Cookie from 'js-cookie'; import _ from 'lodash'; import qs from 'qs'; @@ -23,30 +20,30 @@ import { setCancelTokenSource } from '../index'; import requestMiddleware from '../middleware/request'; import responseMiddleware from '../middleware/response'; -import Cache, { - type CacheExpire, - type CacheValue, -} from './cache'; +import Cache, { type CacheExpire, type CacheValue } from './cache'; import { paramsSerializer } from './utils'; const cacheHandler = new Cache(); -export type Method = 'get' | 'delete' | 'post' | 'put' | 'download' | 'patch' +export type Method = 'get' | 'delete' | 'post' | 'put' | 'download' | 'patch'; export interface Config { - url: string, - method: Method, - params?: Record, + url: string; + method: Method; + params?: Record; payload?: { - timeout?: number, - cache?: string | number | boolean, - onUploadProgress?: (params: CancelTokenSource) => void, - permission?: 'page' | 'dialog' | 'catch', - catchError?: boolean - } & AxiosRequestConfig, + timeout?: number; + cache?: string | number | boolean; + onUploadProgress?: (params: CancelTokenSource) => void; + permission?: 'page' | 'dialog' | 'catch'; + catchError?: boolean; + } & AxiosRequestConfig; } -requestMiddleware(axios.interceptors.request); -responseMiddleware(axios.interceptors.response); +/* @ts-ignore */ +if (axios.interceptors.response.handlers.length < 1) { + requestMiddleware(axios.interceptors.request); + responseMiddleware(axios.interceptors.response); +} const { CancelToken } = axios; const CSRF_TOKEN_KEY = 'dbm_csrftoken'; @@ -76,15 +73,9 @@ const defaultConfig = { }; export default class Request { - static supporMethods = [ - 'get', 'post', 'delete', 'put', 'patch', - ]; - static willCachedMethods = [ - 'get', - ]; - static bodyDataMethods = [ - 'post', 'put', 'delete', 'patch', - ]; + static supporMethods = ['get', 'post', 'delete', 'put', 'patch']; + static willCachedMethods = ['get']; + static bodyDataMethods = ['post', 'put', 'delete', 'patch']; cache: Cache; config: Config; diff --git a/dbm-ui/frontend/src/services/http/middleware/response.ts b/dbm-ui/frontend/src/services/http/middleware/response.ts index a5b804e07a..9274e7ae28 100644 --- a/dbm-ui/frontend/src/services/http/middleware/response.ts +++ b/dbm-ui/frontend/src/services/http/middleware/response.ts @@ -9,29 +9,19 @@ * 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 type { - AxiosError, - AxiosInterceptorManager, - AxiosResponse, -} from 'axios'; + */ +import type { AxiosError, AxiosInterceptorManager, AxiosResponse } from 'axios'; import IamApplyDataModel from '@services/model/iam/apply-data'; import { useEventBus } from '@hooks'; -import { - downloadFile, - messageError, - parseURL, - permissionDialog, -} from '@utils'; +import { downloadFile, messageError, parseURL, permissionDialog } from '@utils'; import { showLoginModal } from '@blueking/login-modal'; import RequestError from '../lib/request-error'; - // 标记已经登录过状态 // 第一次登录跳转登录页面,之后弹框登录 let hasLogined = false; @@ -68,49 +58,49 @@ const handlePermission = (error: RequestError) => { }; export default (interceptors: AxiosInterceptorManager) => { - interceptors.use((response: AxiosResponse) => { - // 处理http响应成功,后端返回逻辑 - switch (response.data.code) { - // 后端业务逻辑处理成功 - case 0: - hasLogined = true; - return response.data; - default: { - // 文件的字节流 - if (response.headers['content-type'] === 'application/octet-stream') { - downloadFile(response); + interceptors.use( + (response: AxiosResponse) => { + // 处理http响应成功,后端返回逻辑 + switch (response.data.code) { + // 后端业务逻辑处理成功 + case 0: + hasLogined = true; return response.data; + default: { + // 文件的字节流 + if (response.headers['content-type'] === 'application/octet-stream') { + downloadFile(response); + return response.data; + } + // 后端逻辑处理报错 + const { code, message = '系统错误' } = response.data; + throw new RequestError(code, message, response); } - // 后端逻辑处理报错 - const { code, message = '系统错误' } = response.data; - throw new RequestError(code, message, response); } - } - }, (error: AxiosError<{ message: string }> & { __CANCEL__: any }) => { - // 超时取消 - if (error.__CANCEL__) { // eslint-disable-line no-underscore-dangle - return Promise.reject(new RequestError('CANCEL', '请求已取消')); - } - // 处理 http 错误响应逻辑 - if (error.response) { - // 登录状态失效 - if (error.response.status === 401) { - return Promise.reject(new RequestError(401, '登录状态失效', error.response)); + }, + (error: AxiosError<{ message: string }> & { __CANCEL__: any }) => { + // 超时取消 + if (error.__CANCEL__) { + // eslint-disable-line no-underscore-dangle + return Promise.reject(new RequestError('CANCEL', '请求已取消')); } - // 默认使用 http 错误描述, - // 如果 response body 里面有自定义错误描述优先使用 - let errorMessage = error.response.statusText; - if (error.response.data && error.response.data.message) { - errorMessage = error.response.data.message as string; + // 处理 http 错误响应逻辑 + if (error.response) { + // 登录状态失效 + if (error.response.status === 401) { + return Promise.reject(new RequestError(401, '登录状态失效', error.response)); + } + // 默认使用 http 错误描述, + // 如果 response body 里面有自定义错误描述优先使用 + let errorMessage = error.response.statusText; + if (error.response.data && error.response.data.message) { + errorMessage = error.response.data.message as string; + } + return Promise.reject(new RequestError(error.response.status || -1, errorMessage, error.response)); } - return Promise.reject(new RequestError( - error.response.status || -1, - errorMessage, - error.response, - )); - } - return Promise.reject(new RequestError(-1, `${window.PROJECT_ENV.VITE_AJAX_URL_PREFIX} 无法访问`)); - }); + return Promise.reject(new RequestError(-1, `${window.PROJECT_ENV.VITE_AJAX_URL_PREFIX} 无法访问`)); + }, + ); // 统一错误处理逻辑 interceptors.use(undefined, (error: RequestError) => { diff --git a/dbm-ui/frontend/src/services/model/sqlserver/migrate-record.ts b/dbm-ui/frontend/src/services/model/sqlserver/migrate-record.ts new file mode 100644 index 0000000000..7708a01f79 --- /dev/null +++ b/dbm-ui/frontend/src/services/model/sqlserver/migrate-record.ts @@ -0,0 +1,123 @@ +/* + * 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 { utcDisplayTime } from '@utils'; + +import { t } from '@locales/index'; + +const enum STATUS { + TODO = 'todo', + TERMINATED = 'terminated', + DISCONNECTING = 'disconnecting', + DISCONNECTED = 'disconnected', + FULL_ONLINE = 'full_online', + FULL_FAILED = 'full_failed', + FULL_SUCCESS = 'full_success', + INCR_ONLINE = 'incr_online', + INCR_FAILED = 'incr_failed', + INCR_SUCCESS = 'incr_success', +} + +export default class MigrateRecord { + static STATUS_TODO = STATUS.TODO; + static STATUS_TERMINATED = STATUS.TERMINATED; + static STATUS_DISCONNECTING = STATUS.DISCONNECTING; + static STATUS_DISCONNECTED = STATUS.DISCONNECTED; + static STATUS_FULL_ONLINE = STATUS.FULL_ONLINE; + static STATUS_FULL_FAILED = STATUS.FULL_FAILED; + static STATUS_FULL_SUCCESS = STATUS.FULL_SUCCESS; + static STATUS_INCR_ONLINE = STATUS.INCR_ONLINE; + static STATUS_INCR_FAILED = STATUS.INCR_FAILED; + static STATUS_INCR_SUCCESS = STATUS.INCR_SUCCESS; + + static statusTextMap = { + [STATUS.TODO]: t('待执行'), + [STATUS.TERMINATED]: t('已终止'), + [STATUS.DISCONNECTING]: t('"中断中'), + [STATUS.DISCONNECTED]: t('已断开'), + [STATUS.FULL_ONLINE]: t('全量传输中'), + [STATUS.FULL_FAILED]: t('全量传输失败'), + [STATUS.FULL_SUCCESS]: t('全量传输完成'), + [STATUS.INCR_ONLINE]: t('增量传输中'), + [STATUS.INCR_FAILED]: t('增量传输失败'), + [STATUS.INCR_SUCCESS]: t('增量传输完成'), + }; + + static statusIconMap = { + [STATUS.TODO]: 'sync-default', + [STATUS.TERMINATED]: 'sync-waiting-01', + [STATUS.DISCONNECTING]: 'sync-pending', + [STATUS.DISCONNECTED]: 'sync-failed', + [STATUS.FULL_ONLINE]: 'sync-pending', + [STATUS.FULL_FAILED]: 'sync-failed', + [STATUS.FULL_SUCCESS]: 'sync-success', + [STATUS.INCR_ONLINE]: 'sync-pending', + [STATUS.INCR_FAILED]: 'sync-failed', + [STATUS.INCR_SUCCESS]: 'sync-success', + }; + + bk_biz_id: number; + create_at: string; + creator: string; + dts_config: { + db_name: string; + target_db_name: string; + }[]; + dts_mode: string; + id: number; + ignore_db_list: string[]; + root_id: string; + source_cluster_domain: string; + source_cluster_id: number; + status: (typeof STATUS)[keyof typeof STATUS]; + target_cluster_domain: string; + target_cluster_id: number; + ticket_id: number; + update_at: string; + updater: string; + + constructor(payload = {} as MigrateRecord) { + this.bk_biz_id = payload.bk_biz_id; + this.create_at = payload.create_at; + this.creator = payload.creator; + this.dts_config = payload.dts_config || []; + this.dts_mode = payload.dts_mode; + this.id = payload.id; + this.ignore_db_list = payload.ignore_db_list || []; + this.root_id = payload.root_id; + this.source_cluster_domain = payload.source_cluster_domain; + this.source_cluster_id = payload.source_cluster_id; + this.status = payload.status; + this.target_cluster_domain = payload.target_cluster_domain; + this.target_cluster_id = payload.target_cluster_id; + this.ticket_id = payload.ticket_id; + this.update_at = payload.update_at; + this.updater = payload.updater; + } + + get dtsModeText() { + return this.dts_mode === 'full' ? t('完整备份迁移(一次性)') : t('增量备份迁移(持续的)'); + } + + get isRunning() { + return [STATUS.TODO, STATUS.DISCONNECTING, STATUS.FULL_ONLINE, STATUS.INCR_ONLINE].includes(this.status); + } + + get tagetDb() { + return this.dts_config.map((item) => item.target_db_name); + } + + get createAtDisplay() { + return utcDisplayTime(this.create_at); + } +} diff --git a/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-cluster.ts b/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-cluster.ts index 3f275c0f0f..0e54b3b04f 100644 --- a/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-cluster.ts +++ b/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-cluster.ts @@ -59,12 +59,15 @@ export default class SqlServerHaCluster extends TimeBaseClassModel { bk_biz_name: string; bk_cloud_id: number; bk_cloud_name: string; + cluster_access_port: number; cluster_alias: string; + cluster_entry: string[]; cluster_name: string; - cluster_time_zone: string; cluster_stats: Record<'used' | 'total' | 'in_use', number>; + cluster_time_zone: string; cluster_type: string; cluster_type_name: string; + create_at: string; creator: string; db_module_id: number; db_module_name: string; @@ -81,6 +84,9 @@ export default class SqlServerHaCluster extends TimeBaseClassModel { ticket_type: string; title: string; }>; + permission: { + sqlserver_view: boolean; + }; phase: string; phase_name: string; region: string; @@ -119,12 +125,15 @@ export default class SqlServerHaCluster extends TimeBaseClassModel { this.bk_biz_name = payload.bk_biz_name; this.bk_cloud_id = payload.bk_cloud_id; this.bk_cloud_name = payload.bk_cloud_name; + this.cluster_access_port = payload.cluster_access_port; this.cluster_alias = payload.cluster_alias; + this.cluster_entry = payload.cluster_entry || []; this.cluster_name = payload.cluster_name; this.cluster_time_zone = payload.cluster_time_zone; this.cluster_stats = payload.cluster_stats || {}; this.cluster_type = payload.cluster_type; this.cluster_type_name = payload.cluster_type_name; + this.create_at = payload.create_at; this.creator = payload.creator; this.db_module_id = payload.db_module_id; this.db_module_name = payload.db_module_name; @@ -133,11 +142,13 @@ export default class SqlServerHaCluster extends TimeBaseClassModel { this.master_domain = payload.master_domain; this.masters = payload.masters; this.operations = payload.operations; + this.permission = payload.permission || {}; this.phase = payload.phase; this.phase_name = payload.phase_name; this.region = payload.region; this.slave_domain = payload.slave_domain; this.slaves = payload.slaves; + this.spec_config = payload.spec_config; this.status = payload.status; this.update_at = payload.update_at; this.updater = payload.updater; diff --git a/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-instance.ts b/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-instance.ts index 5969822672..ef1389aadf 100644 --- a/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-instance.ts +++ b/dbm-ui/frontend/src/services/model/sqlserver/sqlserver-ha-instance.ts @@ -9,19 +9,11 @@ * 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 { - clusterInstStatus, - ClusterInstStatusKeys, -} from '@common/const'; +import { clusterInstStatus, ClusterInstStatusKeys } from '@common/const'; -import { - isRecentDays, - utcDisplayTime, -} from '@utils'; - -import type { HostDetails } from '../../types'; +import { isRecentDays, utcDisplayTime } from '@utils'; export default class SqlServerHaInstance { bk_cloud_id: number; @@ -32,13 +24,17 @@ export default class SqlServerHaInstance { cluster_type: string; create_at: string; db_module_id: number; - host_info: HostDetails; + db_module_name: string; id: number; instance_address: string; ip: string; + machine_type: string; master_domain: string; + permission: { + sqlserver_view: boolean; + }; port: number; - related_clusters?: { + related_clusters: { alias: string; bk_biz_id: number; bk_cloud_id: number; @@ -52,13 +48,33 @@ export default class SqlServerHaInstance { phase: string; region: string; status: string; - time_zone: string + time_zone: string; updater: string; }[]; role: string; slave_domain: string; spec_config: { - id: number + id: number; + cpu: { + max: number; + min: number; + }; + mem: { + max: number; + min: number; + }; + qps: { + max: number; + min: number; + }; + name: string; + count: number; + device_class: string[]; + storage_spec: { + size: number; + type: string; + mount_point: string; + }[]; }; status: ClusterInstStatusKeys; version: string; @@ -72,13 +88,15 @@ export default class SqlServerHaInstance { this.cluster_type = payload.cluster_type; this.create_at = payload.create_at; this.db_module_id = payload.db_module_id; - this.host_info = payload.host_info; + this.db_module_name = payload.db_module_name; this.id = payload.id; this.instance_address = payload.instance_address; this.ip = payload.ip; + this.machine_type = payload.machine_type; this.master_domain = payload.master_domain; + this.permission = payload.permission || {}; this.port = payload.port; - this.related_clusters = payload.related_clusters; + this.related_clusters = payload.related_clusters || []; this.role = payload.role; this.slave_domain = payload.slave_domain; this.spec_config = payload.spec_config; diff --git a/dbm-ui/frontend/src/services/source/dbbase.ts b/dbm-ui/frontend/src/services/source/dbbase.ts index a189770e46..0e9b6031e3 100644 --- a/dbm-ui/frontend/src/services/source/dbbase.ts +++ b/dbm-ui/frontend/src/services/source/dbbase.ts @@ -27,36 +27,16 @@ export function verifyDuplicatedClusterName(params: { cluster_type: string; name /** * 根据过滤条件查询集群详细信息 */ -export function filterClusters(params: { bk_biz_id: number; exact_domain: string }) { - return http.get< - { - bk_biz_id: number; - bk_biz_name: string; - bk_cloud_id: number; - bk_cloud_name: string; - cluster_capacity: number; - cluster_shard_num: number; - cluster_spec: { - cpu: { - max: number; - min: number; - }; - mem: { - max: number; - min: number; - }; - qps: { - max: number; - min: number; - }; - spec_name: string; - }; - db_module_id: number; - id: number; - machine_pair_cnt: number; - master_domain: string; - }[] - >(`${path}/filter_clusters/`, params); +export function filterClusters< + T extends { + bk_biz_id: number; + bk_cloud_id: number; + bk_cloud_name: string; + cluster_name: string; + cluster_type: string; + }, +>(params: { bk_biz_id: number; exact_domain: string }) { + return http.get(`${path}/filter_clusters/`, params); } /* @@ -106,3 +86,18 @@ export function queryWebconsole(params: { cluster_id: number; cmd: string }) { error_msg?: string; }>(`${path}/webconsole/`, params); } +// 查询集群的库是否存在 +export function checkClusterDatabase(params: { bk_biz_id: number; cluster_id: number; db_list: string[] }) { + return http.post>(`${path}/check_cluster_databases/`, params); +} + +// 根据用户手动输入的ip[:port]查询真实的实例 +export function checkInstance< + T extends { + bk_host_id: number; + ip: string; + bk_cloud_id: number; + }, +>(params: { instance_addresses: string[]; bk_biz_id: number }) { + return http.post(`${path}/check_instances/`, params); +} diff --git a/dbm-ui/frontend/src/services/source/instances.ts b/dbm-ui/frontend/src/services/source/instances.ts index ed9a5714c7..336f659c7f 100644 --- a/dbm-ui/frontend/src/services/source/instances.ts +++ b/dbm-ui/frontend/src/services/source/instances.ts @@ -37,10 +37,6 @@ export function checkRedisInstances(params: Record<'instance_addresses', Array(`/apis/mongodb/bizs/${params.bizId}/instance/check_instances/`, params); } diff --git a/dbm-ui/frontend/src/services/source/mysqlCluster.ts b/dbm-ui/frontend/src/services/source/mysqlCluster.ts index 440f27c511..28663b3a43 100644 --- a/dbm-ui/frontend/src/services/source/mysqlCluster.ts +++ b/dbm-ui/frontend/src/services/source/mysqlCluster.ts @@ -21,15 +21,14 @@ const getRootPath = () => `/apis/mysql/bizs/${window.PROJECT_CONFIG.BIZ_ID}/clus /** * 通过集群查询同机关联集群 */ -export function findRelatedClustersByClusterIds(params: { - cluster_ids: number [] - bk_biz_id: number -}) { - return http.post - }>>(`${getRootPath()}/find_related_clusters_by_cluster_ids/`, params); +export function findRelatedClustersByClusterIds(params: { cluster_ids: number[]; bk_biz_id: number }) { + return http.post< + Array<{ + cluster_id: number; + cluster_info: TendbhaModel; + related_clusters: Array; + }> + >(`${getRootPath()}/find_related_clusters_by_cluster_ids/`, params); } /** @@ -50,16 +49,15 @@ export function findRelatedClustersByInstances(params: { /** * 获取关联集群从库的交集 */ -export function getIntersectedSlaveMachinesFromClusters(params: { - bk_biz_id: number, - cluster_ids: number[], -}) { - return http.post>(`${getRootPath()}/get_intersected_slave_machines_from_clusters/`, params); +export function getIntersectedSlaveMachinesFromClusters(params: { bk_biz_id: number; cluster_ids: number[] }) { + return http.post< + Array<{ + bk_biz_id: number; + bk_cloud_id: number; + bk_host_id: number; + ip: string; + }> + >(`${getRootPath()}/get_intersected_slave_machines_from_clusters/`, params); } /** @@ -67,31 +65,34 @@ export function getIntersectedSlaveMachinesFromClusters(params: { */ export function getRemoteMachineInstancePair(params: { instances?: string[]; machines?: string[] }) { return http.post<{ - instances: Record, - machines: Record + instances: Record; + machines: Record; }>(`${getRootPath()}/get_remote_machine_instance_pair/`, params); } /** * 查询tendbcluster集群的remote_db/remote_dr */ -export function getRemoteParis(params: { - cluster_ids: number[] -}) { - return http.post>(`${getRootPath()}/get_remote_pairs/`, params) - .then(data => data.map(item => ({ - cluster_id: item.cluster_id, - remote_pairs: item.remote_pairs.map(remotePair => ({ - remote_db: new RemotePairInstanceModel(remotePair.remote_db), - remote_dr: new RemotePairInstanceModel(remotePair.remote_dr), +export function getRemoteParis(params: { cluster_ids: number[] }) { + return http + .post< + Array<{ + cluster_id: number; + remote_pairs: { + remote_db: RemotePairInstanceModel; + remote_dr: RemotePairInstanceModel; + }[]; + }> + >(`${getRootPath()}/get_remote_pairs/`, params) + .then((data) => + data.map((item) => ({ + cluster_id: item.cluster_id, + remote_pairs: item.remote_pairs.map((remotePair) => ({ + remote_db: new RemotePairInstanceModel(remotePair.remote_db), + remote_dr: new RemotePairInstanceModel(remotePair.remote_dr), + })), })), - }))); + ); } /** @@ -112,6 +113,8 @@ export function queryClusters(params: { /** * 通过集群域名获取集群详情 */ -export function getClusterInfoByDomains(params: Record<'cluster_filters', Array<{ immute_domain: string }>> & { bizId: number }) { +export function getClusterInfoByDomains( + params: Record<'cluster_filters', Array<{ immute_domain: string }>> & { bizId: number }, +) { return http.post(`${getRootPath()}/query_clusters/`, params); } diff --git a/dbm-ui/frontend/src/services/source/sqlImport.ts b/dbm-ui/frontend/src/services/source/sqlImport.ts index 233022f66d..d67ca241d1 100644 --- a/dbm-ui/frontend/src/services/source/sqlImport.ts +++ b/dbm-ui/frontend/src/services/source/sqlImport.ts @@ -6,8 +6,6 @@ import UserSemanticTaskModel from '@services/model/sql-import/user-semantic-task import http from '../http'; -// const path = `/apis/mysql/bizs/${window.PROJECT_CONFIG.BIZ_ID}/sql_import`; - /** * 删除用户语义检查任务列表 */ @@ -82,18 +80,16 @@ export function semanticCheck(params: { bk_biz_id: number; cluster_type: string /** * 获取语义执行的结果日志 */ -export function semanticCheckResultLogs(params: { - cluster_type: string, - root_id: string, - node_id: string, -}) { - return http.post<{ - filename: string; - match_logs: { - timestamp: string; - levelname: string; - message: string; - }[]; - status: string; -}[]>(`/apis/mysql/bizs/${window.PROJECT_CONFIG.BIZ_ID}/sql_import/get_semantic_check_result_logs/`, params); +export function semanticCheckResultLogs(params: { cluster_type: string; root_id: string; node_id: string }) { + return http.post< + { + filename: string; + match_logs: { + timestamp: string; + levelname: string; + message: string; + }[]; + status: string; + }[] + >(`/apis/mysql/bizs/${window.PROJECT_CONFIG.BIZ_ID}/sql_import/get_semantic_check_result_logs/`, params); } diff --git a/dbm-ui/frontend/src/services/source/sqlServerImport.ts b/dbm-ui/frontend/src/services/source/sqlServerImport.ts new file mode 100644 index 0000000000..d78c4db35e --- /dev/null +++ b/dbm-ui/frontend/src/services/source/sqlServerImport.ts @@ -0,0 +1,26 @@ +/* + * 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 http from '../http'; + +const getPath = () => `/apis/sqlserver/bizs/${window.PROJECT_CONFIG.BIZ_ID}`; + +export function uploadSql(params: FormData) { + return http.post< + { + raw_file_name: string; + sql_content: string; + sql_path: string; + }[] + >(`${getPath()}/sql_import/upload_sql/`, params); +} diff --git a/dbm-ui/frontend/src/services/source/sqlServerMigrate.ts b/dbm-ui/frontend/src/services/source/sqlServerMigrate.ts new file mode 100644 index 0000000000..b5557290e5 --- /dev/null +++ b/dbm-ui/frontend/src/services/source/sqlServerMigrate.ts @@ -0,0 +1,37 @@ +/* + * 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 MigrateRecordModel from '@services/model/sqlserver/migrate-record'; + +import http from '../http'; + +const getPath = () => `/apis/sqlserver/bizs/${window.PROJECT_CONFIG.BIZ_ID}/migrate`; + +/** + * 获取迁移记录 + */ +export function getList(params: { cluster_name?: string }) { + return http + .get(`${getPath()}/query_migrate_records/`, params) + .then((data) => data.map((item) => new MigrateRecordModel(item))); +} + +// 强制终止 +export function forceFailedMigrate(params: { dts_id: number }) { + return http.post(`${getPath()}/force_failed_migrate/`, params); +} + +// 断开同步 +export function manualTerminateSync(params: { ticket_id: number }) { + return http.post(`${getPath()}/manual_terminate_sync/`, params); +} diff --git a/dbm-ui/frontend/src/services/source/sqlserveHaCluster.ts b/dbm-ui/frontend/src/services/source/sqlserveHaCluster.ts index 0cf80c6ee4..44b2e9adaf 100644 --- a/dbm-ui/frontend/src/services/source/sqlserveHaCluster.ts +++ b/dbm-ui/frontend/src/services/source/sqlserveHaCluster.ts @@ -34,6 +34,18 @@ export function getHaClusterList(params: { limit?: number; offset?: number }) { })); } +/** + * 获取完整的集群列表 + */ +export function getHaClusterWholeList() { + return http + .get>(`${path}/`, { + limit: -1, + offset: 0, + }) + .then((data) => data.results.map((item) => new SqlServerClusterListModel(item))); +} + /** * 获取集群详情 */ diff --git a/dbm-ui/frontend/src/services/source/sqlserver.ts b/dbm-ui/frontend/src/services/source/sqlserver.ts index 3566570edb..62fa515b5d 100644 --- a/dbm-ui/frontend/src/services/source/sqlserver.ts +++ b/dbm-ui/frontend/src/services/source/sqlserver.ts @@ -9,41 +9,28 @@ * 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 BizConfTopoTreeModel from '@services/model/config/biz-conf-topo-tree'; -import { useGlobalBizs } from '@stores'; - import http from '../http'; -const { currentBizId } = useGlobalBizs(); - -const path = `/apis/sqlserver/bizs/${currentBizId}` +const path = `/apis/sqlserver/bizs/${window.PROJECT_CONFIG.BIZ_ID}`; /** * 判断库名是否在集群存在 */ -export function checkSqlserverDbExist(params: { - cluster_id: number, - db_list: string[] -}) { +export function checkSqlserverDbExist(params: { cluster_id: number; db_list: string[] }) { return http.post>(`${path}/cluster/check_sqlserver_db_exist/`, params); } /** * 通过库表匹配查询db */ -export function getSqlserverDbs(params: { - cluster_id: number, - db_list: string[] - ignore_db_list: string[] -}) { +export function getSqlserverDbs(params: { cluster_id: number; db_list: string[]; ignore_db_list: string[] }) { return http.post(`${path}/cluster/get_sqlserver_dbs/`, params); } - /** * 获取业务拓扑树 */ @@ -51,3 +38,51 @@ export function geSqlserverResourceTree(params: { cluster_type: string }) { return http.get(`${path}/resource_tree/`, params); } +// 通过库表匹配批量查询db +export function getBatchSqlserverDbs(params: { cluster_ids: number[]; db_list: string[]; ignore_db_list: string[] }) { + return http.post>(`${path}/cluster/multi_get_dbs_for_drs/`, params); +} + +// 导入构造DB数据 +export function importDbStruct(params: FormData) { + return http.post[]>( + `${path}/cluster/import_db_struct/`, + params, + ); +} + +// 根据时间范围查询集群备份记录 +export function queryBackupLogs(params: { cluster_id: number; days?: number }) { + return http.post< + { + backup_id: string; + end_time: string; + logs: any[]; + role: string; + start_time: string; + }[] + >(`${path}/rollback/query_backup_logs/`, params); +} + +// 根据备份记录和库匹配模式查询操作库 +export function queryDbsByBackupLog(params: { + cluster_id: number; + db_pattern: string[]; + ignore_db: string[]; + backup_logs?: { + logs: any[]; + }; + restore_time?: string; +}) { + return http.post(`${path}/rollback/query_dbs_by_backup_log/`, params); +} + +// 根据回档时间集群最近备份记录 +export function queryLatestBackupLog(params: { cluster_id: number; rollback_time: string }) { + return http.post<{ + backup_id: string; + end_time: string; + start_time: string; + logs: unknown[]; + }>(`${path}/rollback/query_latest_backup_log/`, params); +} diff --git a/dbm-ui/frontend/src/services/source/ticket.tsx b/dbm-ui/frontend/src/services/source/ticket.tsx index d929dad65b..27d20d420c 100644 --- a/dbm-ui/frontend/src/services/source/ticket.tsx +++ b/dbm-ui/frontend/src/services/source/ticket.tsx @@ -9,7 +9,7 @@ * 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 InfoBox from 'bkui-vue/lib/info-box'; import TicketModel from '@services/model/ticket/ticket'; @@ -22,78 +22,70 @@ import { messageError } from '@utils'; import { locale, t } from '@locales/index'; import http, { type IRequestPayload } from '../http'; -import type { - HostNode, - ListBase, -} from '../types'; -import type { - ClusterOperateRecord, - FlowItem, - FlowItemTodo, - TicketType, -} from '../types/ticket'; +import type { HostNode, ListBase } from '../types'; +import type { ClusterOperateRecord, FlowItem, FlowItemTodo, TicketType } from '../types/ticket'; const path = '/apis/tickets'; - /** * 单据列表 */ -export function getTickets(params: { - bk_biz_id?: number, - ticket_type?: string, - status?: string, - limit?: number, - offset?: number, -} = {}) { - return http.get>(`${path}/`, params) - .then(data => ({ - ...data, - results: data.results.map(item => new TicketModel(item)), - })); +export function getTickets( + params: { + bk_biz_id?: number; + ticket_type?: string; + status?: string; + limit?: number; + offset?: number; + } = {}, +) { + return http.get>(`${path}/`, params).then((data) => ({ + ...data, + results: data.results.map((item) => new TicketModel(item)), + })); } /** * 单据列表项 */ interface TicketItem { - db_app_abbr: string, - bk_biz_id: number, - bk_biz_name: string, - cost_time: number, - create_at: string, - creator: string, - details: any, - id: number, - remark: string, - status: string, - status_display: string, - ticket_type: string, - ticket_type_display: string, - update_at: string, - updater: string, - is_reviewed: boolean, + db_app_abbr: string; + bk_biz_id: number; + bk_biz_name: string; + cost_time: number; + create_at: string; + creator: string; + details: any; + id: number; + remark: string; + status: string; + status_display: string; + ticket_type: string; + ticket_type_display: string; + update_at: string; + updater: string; + is_reviewed: boolean; related_object: { - title: string, - objects: string[] - } + title: string; + objects: string[]; + }; } /** * 创建单据 */ export function createTicket(formData: Record) { - return http.post(`${path}/`, formData, { catchError: true }) - .then(res => res) + return http + .post(`${path}/`, formData, { catchError: true }) + .then((res) => res) .catch((e) => { - const { - code, - data, - } = e; + console.log('ticker erro = ', e); + const { code, data } = e; const duplicateCode = 8704005; if (code === duplicateCode) { const id = data.duplicate_ticket_id; const router = getRouter(); + console.log('router = ', router); const route = router.resolve({ name: 'bizTicketManage', query: { @@ -108,7 +100,12 @@ export function createTicket(formData: Record) { return ( You have already submitted a - ticket[{id}] + + {' '} + ticket[{id}]{' '} + with the same target cluster, continue? ); @@ -117,7 +114,11 @@ export function createTicket(formData: Record) { return ( 你已提交过包含相同目标集群的 - 单据[{id}] + + 单据[{id}] + ,是否继续? ); @@ -145,6 +146,8 @@ export function createTicket(formData: Record) { }); } + messageError(e.message); + return Promise.reject(e); }); } @@ -157,22 +160,22 @@ export function getTicketTypes(params?: { is_apply: 0 | 1 }) { } /** - * 查询集群变更单据事件 - */ + * 查询集群变更单据事件 + */ export function getClusterOperateRecords(params: Record & { cluster_id: number }) { return http.get>(`${path}/get_cluster_operate_records/`, params); } /** - * 查询集群实例变更单据事件 - */ + * 查询集群实例变更单据事件 + */ export function getInstanceOperateRecords(params: Record & { instance_id: number }) { return http.get>(`${path}/get_instance_operate_records/`, params); } /** - * 待办单据数 - */ + * 待办单据数 + */ export function getTicketsCount(params: { count_type: 'MY_TODO' | 'MY_APPROVE' }) { return http.get(`${path}/get_tickets_count/`, params); } @@ -180,29 +183,32 @@ export function getTicketsCount(params: { count_type: 'MY_TODO' | 'MY_APPROVE' } /** * 待办单据列表 */ -export function getTodoTickets(params: { - bk_biz_id?: number, - ticket_type?: string, - status?: string, - limit?: number, - offset?: number, -} = {}) { - return http.get>(`${path}/get_todo_tickets/`, params) - .then(data => ({ - ...data, - results: data.results.map(item => new TicketModel(item)), - })); +export function getTodoTickets( + params: { + bk_biz_id?: number; + ticket_type?: string; + status?: string; + limit?: number; + offset?: number; + } = {}, +) { + return http.get>(`${path}/get_todo_tickets/`, params).then((data) => ({ + ...data, + results: data.results.map((item) => new TicketModel(item)), + })); } /** * 单据详情 */ -export function getTicketDetails(params: { - id: number, - is_reviewed?: number -}, payload = {} as IRequestPayload) { - return http.get(`${path}/${params.id}/`, params, payload) - .then(data => new TicketModel(data)); +export function getTicketDetails( + params: { + id: number; + is_reviewed?: number; + }, + payload = {} as IRequestPayload, +) { + return http.get(`${path}/${params.id}/`, params, payload).then((data) => new TicketModel(data)); } /** @@ -215,12 +221,7 @@ export function getTicketFlows(params: { id: number }) { /** * 节点列表 */ -export function getTicketHostNodes(params: { - bk_biz_id: number, - id: number, - role: string, - keyword?: string -}) { +export function getTicketHostNodes(params: { bk_biz_id: number; id: number; role: string; keyword?: string }) { return http.get(`${path}/${params.id}/get_nodes/`, params); } @@ -228,55 +229,53 @@ export function getTicketHostNodes(params: { * 待办处理 */ export function processTicketTodo(params: { - action: string, - todo_id: number, - ticket_id: number, - params: Record + action: string; + todo_id: number; + ticket_id: number; + params: Record; }) { return http.post(`${path}/${params.ticket_id}/process_todo/`, params); } /** - * 单据流程重试 - */ -export function retryTicketFlow(params: { - ticketId: number, - flow_id: number -}) { + * 单据流程重试 + */ +export function retryTicketFlow(params: { ticketId: number; flow_id: number }) { return http.post(`${path}/${params.ticketId}/retry_flow/`, params); } /** - * 查询可编辑单据流程描述 - */ + * 查询可编辑单据流程描述 + */ export function queryTicketFlowDescribe(params: { - db_type: string, - ticket_types?: string, - limit?: number, - offset?: number, - bk_biz_id?: number, + db_type: string; + ticket_types?: string; + limit?: number; + offset?: number; + bk_biz_id?: number; }) { // 组件 db-table 传值问题,临时解决 bk_biz_id 多余传值 // eslint-disable-next-line no-param-reassign delete params.bk_biz_id; - return http.get>(`${path}/query_ticket_flow_describe/`, params) - .then(data => ({ - ...data, - results: data.results.map(item => new TicketFlowDescribeModel(Object.assign(item, { - permission: data.permission - }))) - })); + return http.get>(`${path}/query_ticket_flow_describe/`, params).then((data) => ({ + ...data, + results: data.results.map( + (item) => + new TicketFlowDescribeModel( + Object.assign(item, { + permission: data.permission, + }), + ), + ), + })); } /** - * 修改可编辑的单据流程 - */ -export function updateTicketFlowConfig(params: { - ticket_types: string[], - configs: Record, -}) { + * 修改可编辑的单据流程 + */ +export function updateTicketFlowConfig(params: { ticket_types: string[]; configs: Record }) { return http.post<{ - ticket_types: string[], + ticket_types: string[]; }>(`${path}/update_ticket_flow_config/`, params); } diff --git a/dbm-ui/frontend/src/types/vite-env.d.ts b/dbm-ui/frontend/src/types/vite-env.d.ts index 6af3f29afa..3999e8b544 100644 --- a/dbm-ui/frontend/src/types/vite-env.d.ts +++ b/dbm-ui/frontend/src/types/vite-env.d.ts @@ -10,3 +10,7 @@ * 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. */ + +// / + +/* eslint-disable-next-line */ diff --git a/dbm-ui/frontend/src/utils/checkDbConsole.ts b/dbm-ui/frontend/src/utils/checkDbConsole.ts index a6344314f1..8bdacb3032 100644 --- a/dbm-ui/frontend/src/utils/checkDbConsole.ts +++ b/dbm-ui/frontend/src/utils/checkDbConsole.ts @@ -12,7 +12,7 @@ */ import { type ExtractedControllerDataKeys } from '@services/model/function-controller/functionController'; -import { useSystemEnviron, useFunController } from '@stores'; +import { useFunController, useSystemEnviron } from '@stores'; /** * 检查 dbconsole 开关 diff --git a/dbm-ui/frontend/src/views/mysql/common/edit-field/DbName.vue b/dbm-ui/frontend/src/views/mysql/common/edit-field/DbName.vue index 30c677c815..e82f453fe5 100644 --- a/dbm-ui/frontend/src/views/mysql/common/edit-field/DbName.vue +++ b/dbm-ui/frontend/src/views/mysql/common/edit-field/DbName.vue @@ -25,16 +25,17 @@ import { ref, watch } from 'vue'; import { useI18n } from 'vue-i18n'; - import { checkClusterDatabase } from '@services/source/remoteService'; + import { checkClusterDatabase } from '@services/source/dbbase'; import TableTagInput from '@components/render-table/columns/tag-input/index.vue'; interface Props { modelValue?: string[]; - clusterId: number; + clusterId?: number; required?: boolean; single?: boolean; checkExist?: boolean; + checkNotExist?: boolean; rules?: { validator: (value: string[]) => boolean; message: string; @@ -52,10 +53,11 @@ const props = withDefaults(defineProps(), { modelValue: undefined, + clusterId: undefined, required: true, single: false, - remoteExist: false, checkExist: false, + checkNotExist: false, rules: undefined, }); @@ -106,23 +108,38 @@ if (!props.checkExist) { return true; } + if (!props.clusterId) { + return false; + } + const clearDbList = _.filter(value, (item) => !/[*%]/.test(item)); + if (clearDbList.length < 1) { + return true; + } + return checkClusterDatabase({ + bk_biz_id: window.PROJECT_CONFIG.BIZ_ID, + cluster_id: props.clusterId, + db_list: value, + }).then((data) => !data[value[0]]); + }, + message: t('DB 不存在'), + }, + { + validator: (value: string[]) => { + if (!props.checkNotExist) { + return true; + } + if (!props.clusterId) { + return false; + } const clearDbList = _.filter(value, (item) => !/[*%]/.test(item)); if (clearDbList.length < 1) { return true; } return checkClusterDatabase({ - infos: [ - { - cluster_id: props.clusterId, - db_names: value, - }, - ], - }).then((data) => { - if (data.length < 1) { - return false; - } - return _.every(Object.values(data[0].check_info), (item) => item); - }); + bk_biz_id: window.PROJECT_CONFIG.BIZ_ID, + cluster_id: props.clusterId, + db_list: value, + }).then((data) => data[value[0]]); }, message: t('DB 不存在'), }, @@ -153,6 +170,7 @@ const handleChange = (value: string[]) => { localValue.value = value; + console.log('from tag change = ', value); emits('update:modelValue', value); emits('change', value); }; diff --git a/dbm-ui/frontend/src/views/mysql/common/edit-field/TableName.vue b/dbm-ui/frontend/src/views/mysql/common/edit-field/TableName.vue index 9c522b9140..742146989f 100644 --- a/dbm-ui/frontend/src/views/mysql/common/edit-field/TableName.vue +++ b/dbm-ui/frontend/src/views/mysql/common/edit-field/TableName.vue @@ -29,9 +29,9 @@ interface Props { modelValue?: string[]; - clusterId: number; - placeholder?: string; + clusterId?: number; required?: boolean; + placeholder?: string; single?: boolean; rules?: { validator: (value: string[]) => boolean; @@ -51,6 +51,7 @@ const props = withDefaults(defineProps(), { modelValue: undefined, placeholder: '', + clusterId: undefined, required: true, single: false, rules: undefined, diff --git a/dbm-ui/frontend/src/views/mysql/common/edit/Select.vue b/dbm-ui/frontend/src/views/mysql/common/edit/Select.vue index 8316ad947e..972d2ae75b 100644 --- a/dbm-ui/frontend/src/views/mysql/common/edit/Select.vue +++ b/dbm-ui/frontend/src/views/mysql/common/edit/Select.vue @@ -188,7 +188,7 @@ onMounted(() => { tippyIns = tippy(rootRef.value as SingleTarget, { content: popRef.value, - placement: 'bottom', + placement: 'bottom-start', appendTo: () => document.body, theme: 'table-edit-select light', maxWidth: 'none', @@ -199,7 +199,7 @@ onShow: () => { const { width } = rootRef.value.getBoundingClientRect(); Object.assign(popRef.value.style, { - width: `${width}px`, + minWidth: `${width}px`, }); isShowPop.value = true; isError.value = false; diff --git a/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/detail/Index.vue b/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/detail/Index.vue index 427ebd1b54..220afeda3c 100644 --- a/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/detail/Index.vue +++ b/dbm-ui/frontend/src/views/mysql/ha-cluster-list/components/detail/Index.vue @@ -66,12 +66,13 @@ import { useGlobalBizs } from '@stores'; import { ClusterTypes, DBTypes } from '@common/const'; - import { checkDbConsole } from '@utils'; import ClusterTopo from '@components/cluster-details/ClusterTopo.vue'; import ClusterEventChange from '@components/cluster-event-change/EventChange.vue'; import MonitorDashboard from '@components/cluster-monitor/MonitorDashboard.vue'; + import { checkDbConsole } from '@utils'; + import BaseInfo from './components/BaseInfo.vue'; interface Props { @@ -137,7 +138,6 @@ immediate: true, }, ); - diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/Index.vue new file mode 100644 index 0000000000..4e890915b9 --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/Index.vue @@ -0,0 +1,138 @@ + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ClusterDb.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ClusterDb.vue new file mode 100644 index 0000000000..3018fb95b3 --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ClusterDb.vue @@ -0,0 +1,109 @@ + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ExportBtn.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ExportBtn.vue new file mode 100644 index 0000000000..e4bb4c644d --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ExportBtn.vue @@ -0,0 +1,42 @@ + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ImportBtn.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ImportBtn.vue new file mode 100644 index 0000000000..f1a15a4a6d --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/ImportBtn.vue @@ -0,0 +1,73 @@ + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/Index.vue new file mode 100644 index 0000000000..d82e2a5faa --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/Index.vue @@ -0,0 +1,85 @@ + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/RenderRow.vue b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/RenderRow.vue new file mode 100644 index 0000000000..723eb02a4d --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/common/edit-rename-info/components/rename-list/RenderRow.vue @@ -0,0 +1,188 @@ + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate-record/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate-record/Index.vue new file mode 100644 index 0000000000..97830575d7 --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate-record/Index.vue @@ -0,0 +1,176 @@ + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/Index.vue new file mode 100644 index 0000000000..a699b45363 --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/Index.vue @@ -0,0 +1,49 @@ + + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/Index.vue new file mode 100644 index 0000000000..78b1c7bdc8 --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/Index.vue @@ -0,0 +1,236 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Index.vue new file mode 100644 index 0000000000..036cb709eb --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Index.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderCluster.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderCluster.vue new file mode 100644 index 0000000000..7c12c894ea --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderCluster.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderRename.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderRename.vue new file mode 100644 index 0000000000..4c1bb8a7c9 --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/RenderRename.vue @@ -0,0 +1,187 @@ + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Row.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Row.vue new file mode 100644 index 0000000000..d82d6f47ef --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page1/components/render-data/Row.vue @@ -0,0 +1,213 @@ + + + + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page2/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page2/Index.vue new file mode 100644 index 0000000000..08cbe3361b --- /dev/null +++ b/dbm-ui/frontend/src/views/sqlserver-manage/data-migrate/pages/page2/Index.vue @@ -0,0 +1,87 @@ + + + + diff --git a/dbm-ui/frontend/src/views/sqlserver-manage/db-backup/pages/page1/Index.vue b/dbm-ui/frontend/src/views/sqlserver-manage/db-backup/pages/page1/Index.vue index d752c12813..4fa8d17679 100644 --- a/dbm-ui/frontend/src/views/sqlserver-manage/db-backup/pages/page1/Index.vue +++ b/dbm-ui/frontend/src/views/sqlserver-manage/db-backup/pages/page1/Index.vue @@ -13,18 +13,10 @@