From 52e2d585672ea679fcc3cbae9854dbbc05fcf8d6 Mon Sep 17 00:00:00 2001 From: fit2cloud-jiangweidong <80373698+fit2cloud-jiangweidong@users.noreply.github.com> Date: Thu, 9 Sep 2021 04:04:40 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=B9=E5=AF=86=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=95=B0=E6=8D=AE=E5=BA=93=E6=94=B9=E5=AF=86?= =?UTF-8?q?=20(#991)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 改密计划支持数据库改密 * perf: 修改应用账号 * merge: dev * perf: 暂存修改数据库 * fix: bug * fix: bug * perf: 优化系统用户详情,增加应用列表 * perf: 修改clone * fix: 修复更新系统用户bug Co-authored-by: ibuler Co-authored-by: feng626 <1304903146@qq.com> --- .env.development | 2 - .../AppAccountListTable/ShowSecretInfo.vue | 5 +- src/components/AppAccountListTable/index.vue | 4 +- src/components/index.js | 1 + src/i18n/langs/cn.json | 21 +- src/i18n/langs/en.json | 19 +- src/layout/components/TabPage/index.vue | 46 +++- src/router/accounts.js | 73 ++++-- .../AppChangeAuthPlanCreateUpdate.vue | 106 +++++++++ .../AppChangeAuthPlanList.vue | 129 ++++++++++ .../ChangeAuthPlanExecutionInfo.vue | 68 ++++++ .../ChangeAuthPlanExecutionTaskList.vue | 92 +++++++ .../ChangeAuthPlanExecutionDetail/index.vue | 55 +++++ .../ChangeAuthPlanExecutionList.vue | 122 ++++++++++ .../AppChangeAuthPlanInfo.vue | 96 ++++++++ .../ChangeAuthPlanApp/index.vue | 105 ++++++++ .../ChangeAuthPlanDetail/index.vue | 50 ++++ .../ChangeAuthPlanCreateUpdate.vue | 72 ++++++ .../ChangeAuthPlanAsset/index.vue | 9 +- .../ChangeAuthPlanExecutionInfo.vue | 0 .../ChangeAuthPlanExecutionTaskList.vue | 0 .../ChangeAuthPlanExecutionDetail/index.vue | 0 .../ChangeAuthPlanExecutionList.vue | 0 .../ChangeAuthPlanInfo.vue | 0 .../ChangeAuthPlanDetail/index.vue | 0 .../ChangeAuthPlanList.vue | 31 ++- .../ChangeAuthPlanCreateUpdate.vue | 164 ------------- src/views/accounts/ChangeAuthPlan/fields.js | 225 ++++++++++++++++++ src/views/accounts/ChangeAuthPlan/index.vue | 42 ++++ .../SystemUserDetail/AppAccountList.vue | 35 +++ .../SystemUser/SystemUserDetail/AppList.vue | 126 ++++++++++ .../SystemUser/SystemUserDetail/index.vue | 31 ++- src/views/xpack/index/Vault.vue | 13 - 33 files changed, 1510 insertions(+), 232 deletions(-) create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/AppChangeAuthPlanCreateUpdate.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/AppChangeAuthPlanList.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/AppChangeAuthPlanInfo.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/ChangeAuthPlanApp/index.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AppChangeAuthPlan/ChangeAuthPlanDetail/index.vue create mode 100644 src/views/accounts/ChangeAuthPlan/AssetChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanDetail/ChangeAuthPlanAsset/index.vue (95%) rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionInfo.vue (100%) rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/ChangeAuthPlanExecutionTaskList.vue (100%) rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionDetail/index.vue (100%) rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanDetail/ChangeAuthPlanExecution/ChangeAuthPlanExecutionList.vue (100%) rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanDetail/ChangeAuthPlanInfo.vue (100%) rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanDetail/index.vue (100%) rename src/views/accounts/ChangeAuthPlan/{ => AssetChangeAuthPlan}/ChangeAuthPlanList.vue (73%) delete mode 100644 src/views/accounts/ChangeAuthPlan/ChangeAuthPlanCreateUpdate.vue create mode 100644 src/views/accounts/ChangeAuthPlan/fields.js create mode 100644 src/views/accounts/ChangeAuthPlan/index.vue create mode 100644 src/views/assets/SystemUser/SystemUserDetail/AppAccountList.vue create mode 100644 src/views/assets/SystemUser/SystemUserDetail/AppList.vue delete mode 100644 src/views/xpack/index/Vault.vue diff --git a/.env.development b/.env.development index af09e9e8e..78ca8aaef 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,6 @@ # 全局环境变量 请勿随意改动 ENV = 'development' - - # base api VUE_APP_BASE_API = '' VUE_APP_PUBLIC_PATH = '/ui/' diff --git a/src/components/AppAccountListTable/ShowSecretInfo.vue b/src/components/AppAccountListTable/ShowSecretInfo.vue index a5a631bb3..b9e3871a4 100644 --- a/src/components/AppAccountListTable/ShowSecretInfo.vue +++ b/src/components/AppAccountListTable/ShowSecretInfo.vue @@ -17,7 +17,7 @@
- + @@ -62,8 +62,7 @@ export default { }, methods: { getAuthInfo() { - console.log(this.account) - const url = `/api/v1/applications/account-secrets/${this.account.uid}/` + const url = `/api/v1/applications/account-secrets/${this.account.id}/` this.$axios.get(url, { disableFlashErrorMsg: true }).then(resp => { this.authInfo = resp this.showAuthInfo = true diff --git a/src/components/AppAccountListTable/index.vue b/src/components/AppAccountListTable/index.vue index d9c7a19c1..e8e324b60 100644 --- a/src/components/AppAccountListTable/index.vue +++ b/src/components/AppAccountListTable/index.vue @@ -48,11 +48,11 @@ export default { tableConfig: { url: this.url, columns: [ - 'app_name', 'username', 'category_display', + 'app_display', 'username', 'category_display', 'type_display', 'systemuser', 'actions' ], columnsMeta: { - app_name: { + app_display: { showOverflowTooltip: true, formatter: DetailFormatter, formatterArgs: { diff --git a/src/components/index.js b/src/components/index.js index 9ce17b21e..df7aa70b7 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -23,5 +23,6 @@ export { default as Switcher } from './FormFields/Swicher' export { default as SummaryCard } from './SummaryCard' export { default as UploadField } from './FormFields/UploadField' export { default as AccountListTable } from './AccountListTable/index' +export { default as AppAccountListTable } from './AppAccountListTable' export { default as AssetRelationCard } from './AssetRelationCard' export { default as MFAVerifyDialog } from './MFAVerifyDialog' diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index de9a283c7..0c63ab973 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -30,9 +30,11 @@ "applications": { "": "", "updateAccountMsg": "请更新系统用户的账号信息", + "associateApplication": "关联应用", "RemoteApp": "远程应用", "Database": "数据库", "Cloud": "云", + "App": "应用", "applicationsType": { "chrome": "Chrome", "mysql_workbench": "MySQL Workbench", @@ -84,6 +86,7 @@ "DBInfo": "数据库信息" }, "assets": { + "AppList": "应用列表", "AssociateSystemUsers": "关联系统用户", "AssociateAssets": "关联资产", "AssociateNodes": "关联节点", @@ -1127,17 +1130,31 @@ "xpack": { "Admin": "管理员", "Asset": "资产", + "Database": "数据库", "AssetCount": "资产数量", "Auditor": "审计员", "ChangeAuthPlan": { "AddAsset": "添加资产", "AddNode": "添加节点", + "AddSystemUser": "添加系统用户", "Asset": "资产", + "Database": "数据库", + "DatabaseId": "数据库Id", + "AppAmount": "应用数量", + "SystemUserAmount": "系统用户数量", + "SystemUser": "系统用户", + "SystemUserId": "系统用户Id", "AssetAmount": "资产数量", "AssetAndNode": "资产和节点", "ChangeAuthPlan": "改密计划", - "ChangeAuthPlanCreate": "创建改密计划", - "ChangeAuthPlanUpdate": "更新改密计划", + "AssetChangeAuthPlan": "资产改密计划", + "AppChangeAuthPlan": "应用改密计划", + "AssetChangeAuthPlanCreate": "创建资产改密计划", + "AppChangeAuthPlanCreate": "创建应用改密计划", + "AssetChangeAuthPlanUpdate": "更新资产改密计划", + "AppChangeAuthPlanUpdate": "更新应用改密计划", + "SymbolSet": "特殊符号集合", + "SymbolSetHelpText": "请输入此类型数据库支持的特殊符号集合,若生成的随机密码中有此类数据库不支持的特殊字符,改密计划将会失败", "CyclePerform": "周期执行", "DateJoined": "创建日期", "DateStart": "开始日期", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index fc7aac553..e792f924c 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -29,9 +29,11 @@ "applications": { "": "", "updateAccountMsg": "Please update system user account info", + "associateApplication": "Associate application", "RemoteApp": "Remote app", "Database": "Database", "Cloud": "Cloud", + "App": "Application", "applicationsType": { "chrome": "Chrome", "mysql_workbench": "MySQL Workbench", @@ -83,6 +85,7 @@ "DBInfo": "Database Info" }, "assets": { + "AppList": "Application list", "AssociateSystemUsers": "Associate system users", "AssociateAssets": "Associate assets", "AssociateNodes": "Associate nodes", @@ -1097,17 +1100,29 @@ "xpack": { "Admin": "Admin", "Asset": "Asset", + "Database": "Database", "AssetCount": "Asset count", "Auditor": "Auditor", "ChangeAuthPlan": { "AddAsset": "Add asset", "AddNode": "Add node", + "AddSystemUser": "Add systemuser", "Asset": "Asset", + "Database": "Database", + "DatabaseId": "Database Id", + "SystemUser": "SystemUser", + "SystemUserId": "SystemUser Id", "AssetAmount": "Asset", "AssetAndNode": "Asset and Node", "ChangeAuthPlan": "Change Auth Plan", - "ChangeAuthPlanCreate": "Create change auth plan", - "ChangeAuthPlanUpdate": "Update change auth plan", + "AssetChangeAuthPlan": "Asset Change Auth Plan", + "AppChangeAuthPlan": "App Change Auth Plan", + "AssetChangeAuthPlanCreate": "Create Asset change auth plan", + "AppChangeAuthPlanCreate": "Create App change auth plan", + "AssetChangeAuthPlanUpdate": "Update Asset change auth plan", + "AppChangeAuthPlanUpdate": "Update App change auth plan", + "SymbolSet": "Special symbol set", + "SymbolSetHelpText": "Please enter the special symbol set supported by this type of database. If there are special characters in the generated random password that are not supported by this type of database, the password change plan will fail", "CyclePerform": "Cycle perform", "DateJoined": "Date joined", "DateStart": "Date start", diff --git a/src/layout/components/TabPage/index.vue b/src/layout/components/TabPage/index.vue index b2453d9ff..a0f4414b6 100644 --- a/src/layout/components/TabPage/index.vue +++ b/src/layout/components/TabPage/index.vue @@ -8,9 +8,21 @@
- +