From a9b3ae7aa75ea2598e1ca3f6dc07f3d12f8e4eae Mon Sep 17 00:00:00 2001 From: 3octaves <873551943@qq.com> Date: Fri, 13 Sep 2024 18:23:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E6=9D=83=E9=99=90=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=B5=20#6905?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/frontend/.vscode/settings.json | 69 +- dbm-ui/frontend/package.json | 2 +- .../frontend/src/common/const/dbOperations.ts | 33 + dbm-ui/frontend/src/common/const/index.ts | 1 + .../src/components/cluster-selector/Index.vue | 59 +- .../components/tendbha/Index.vue | 2 +- .../components/instance-selector/Index.vue | 190 +++++- .../components/tendb-ha-host/Index.vue | 274 ++++++++ .../components/tendb-ha-host/table/Index.vue | 340 ++++++++++ .../tendb-ha-host/table/useTableData.ts | 107 +++ .../components/tendb-ha-host/useTopoData.ts | 107 +++ .../components/tendb-single-host/Index.vue | 274 ++++++++ .../tendb-single-host/table/Index.vue | 340 ++++++++++ .../tendb-single-host/table/useTableData.ts | 107 +++ .../tendb-single-host/useTopoData.ts | 107 +++ .../src/components/mult-line-text/Index.vue | 34 +- .../components/module-group/Mysql.vue | 7 + .../components/module-group/TendbCluster.vue | 7 + dbm-ui/frontend/src/locales/zh-cn.json | 21 + .../services/model/mysql/tendbHaMachine.ts | 151 +++++ .../model/mysql/tendbSingleMachine.ts | 151 +++++ .../services/model/spider/spiderMachine.ts | 12 +- .../src/services/source/mysqlPermission.ts | 106 +++ .../frontend/src/services/source/tendbha.ts | 23 + .../src/services/source/tendbsingle.ts | 23 + dbm-ui/frontend/src/types/router.d.ts | 1 + .../mysql/permission-rule/common/const.ts | 31 - .../permission-rule/components/CreateRule.vue | 22 +- .../db-manage/mysql/permission-rule/index.vue | 10 +- .../src/views/db-manage/mysql/routes.ts | 11 + .../tendb-cluster/permission-list/Index.vue | 10 +- .../tendb-cluster/permission/Index.vue | 10 +- .../tendb-cluster/permission/common/consts.ts | 9 - .../permission/components/CreateRule.vue | 20 +- .../views/db-manage/tendb-cluster/routes.ts | 12 + .../src/views/permission-retrieve/Index.vue | 152 +++++ .../components/options/Index.vue | 470 +++++++++++++ .../options/components/BatchInput.vue | 122 ++++ .../components/result/Index.vue | 627 ++++++++++++++++++ 39 files changed, 3893 insertions(+), 161 deletions(-) create mode 100644 dbm-ui/frontend/src/common/const/dbOperations.ts create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/Index.vue create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/table/Index.vue create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/table/useTableData.ts create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-ha-host/useTopoData.ts create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-single-host/Index.vue create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-single-host/table/Index.vue create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-single-host/table/useTableData.ts create mode 100644 dbm-ui/frontend/src/components/instance-selector/components/tendb-single-host/useTopoData.ts create mode 100644 dbm-ui/frontend/src/services/model/mysql/tendbHaMachine.ts create mode 100644 dbm-ui/frontend/src/services/model/mysql/tendbSingleMachine.ts create mode 100644 dbm-ui/frontend/src/services/source/mysqlPermission.ts create mode 100644 dbm-ui/frontend/src/views/permission-retrieve/Index.vue create mode 100644 dbm-ui/frontend/src/views/permission-retrieve/components/options/Index.vue create mode 100644 dbm-ui/frontend/src/views/permission-retrieve/components/options/components/BatchInput.vue create mode 100644 dbm-ui/frontend/src/views/permission-retrieve/components/result/Index.vue diff --git a/dbm-ui/frontend/.vscode/settings.json b/dbm-ui/frontend/.vscode/settings.json index 1f2666a091..69bce4736a 100644 --- a/dbm-ui/frontend/.vscode/settings.json +++ b/dbm-ui/frontend/.vscode/settings.json @@ -1,60 +1,19 @@ { - "eslint.validate": ["javascript", "javascriptreact", "html", "vue"], - "eslint.alwaysShowStatus": true, + "files.eol": "\n", + "editor.unfoldOnClickAfterEndOfLine": true, + "editor.tabSize": 2, + "diffEditor.ignoreTrimWhitespace": false, + "typescript.updateImportsOnFileMove.enabled": "always", + "explorer.confirmDelete": false, + "explorer.confirmDragAndDrop": false, + "editor.fontLigatures": false, + "editor.fontVariations": false, + "i18n-lazyer.defaultFolder": "\\src\\locales", + "search.smartCase": 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.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": false, - "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" - }, - "typescript.tsdk": "node_modules/typescript/lib" -} \ No newline at end of file + "editor.defaultFormatter": "esbenp.prettier-vscode" +} diff --git a/dbm-ui/frontend/package.json b/dbm-ui/frontend/package.json index 1ba0f12229..6697f96358 100644 --- a/dbm-ui/frontend/package.json +++ b/dbm-ui/frontend/package.json @@ -27,7 +27,7 @@ "@icon-cool/bk-icon-bk-biz-components": "0.0.4", "@vueuse/core": "^11.0.3", "axios": "^1.7.7", - "bkui-vue": "2.0.1-beta.69", + "bkui-vue": "^2.0.1-beta.69", "date-fns": "3.6.0", "dayjs": "^1.11.13", "html-to-image": "1.11.11", diff --git a/dbm-ui/frontend/src/common/const/dbOperations.ts b/dbm-ui/frontend/src/common/const/dbOperations.ts new file mode 100644 index 0000000000..a8f059c42f --- /dev/null +++ b/dbm-ui/frontend/src/common/const/dbOperations.ts @@ -0,0 +1,33 @@ +export const MysqlDbOperations = { + dml: ['select', 'insert', 'update', 'delete', 'show view'], + ddl: [ + 'create', + 'alter', + 'drop', + 'index', + 'create view', + 'execute', + 'trigger', + 'event', + 'create routine', + 'alter routine', + 'references', + 'create temporary tables', + ], + glob: ['file', 'reload', 'show databases', 'process', 'replication slave', 'replication client'], +}; + +export const MysqlDdlSensitiveWords = [ + 'trigger', + 'event', + 'create routine', + 'alter routine', + 'references', + 'create temporary tables', +]; + +export const TendbClusterDbOperations = { + dml: ['select', 'insert', 'update', 'delete'], + ddl: ['execute'], + glob: ['file', 'reload', 'process', 'show databases'], +}; diff --git a/dbm-ui/frontend/src/common/const/index.ts b/dbm-ui/frontend/src/common/const/index.ts index 658513ffc2..453a695286 100644 --- a/dbm-ui/frontend/src/common/const/index.ts +++ b/dbm-ui/frontend/src/common/const/index.ts @@ -3,6 +3,7 @@ export * from './clusterInsStatus'; export * from './clusterTypeInfos'; export * from './clusterTypes'; export * from './confLevels'; +export * from './dbOperations'; export * from './dbSysExclude'; export * from './dbTypeInfos'; export * from './dbTypes'; diff --git a/dbm-ui/frontend/src/components/cluster-selector/Index.vue b/dbm-ui/frontend/src/components/cluster-selector/Index.vue index b4b1491a24..5294cce8fc 100644 --- a/dbm-ui/frontend/src/components/cluster-selector/Index.vue +++ b/dbm-ui/frontend/src/components/cluster-selector/Index.vue @@ -101,13 +101,21 @@ diff --git a/dbm-ui/frontend/src/views/permission-retrieve/components/options/Index.vue b/dbm-ui/frontend/src/views/permission-retrieve/components/options/Index.vue new file mode 100644 index 0000000000..f3964761a3 --- /dev/null +++ b/dbm-ui/frontend/src/views/permission-retrieve/components/options/Index.vue @@ -0,0 +1,470 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/permission-retrieve/components/options/components/BatchInput.vue b/dbm-ui/frontend/src/views/permission-retrieve/components/options/components/BatchInput.vue new file mode 100644 index 0000000000..097f663e75 --- /dev/null +++ b/dbm-ui/frontend/src/views/permission-retrieve/components/options/components/BatchInput.vue @@ -0,0 +1,122 @@ + + + + + + + diff --git a/dbm-ui/frontend/src/views/permission-retrieve/components/result/Index.vue b/dbm-ui/frontend/src/views/permission-retrieve/components/result/Index.vue new file mode 100644 index 0000000000..e4accb9c0d --- /dev/null +++ b/dbm-ui/frontend/src/views/permission-retrieve/components/result/Index.vue @@ -0,0 +1,627 @@ + + + + + + +