From e18726efc26d708881779f4f574cfc511a22fa68 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 13 Nov 2024 18:46:24 +0800 Subject: [PATCH] perf: update accout check --- src/router/pam/security.js | 14 +++++++++--- src/router/pam/service.js | 4 ++-- .../AccountPush/AccountPushDetail/index.vue | 2 +- .../AccountPush/AccountPushExecutionList.vue | 4 ++-- .../accounts/AccountPush/AccountPushList.vue | 2 +- ...pdate.vue => AccountCheckCreateUpdate.vue} | 13 +---------- .../AccountPushInfo.vue | 0 .../index.vue | 2 +- .../AccountPushExecutionInfo.vue | 0 .../AccountPushExecutionTaskList.vue | 0 .../index.vue | 0 ...List.vue => AccountCheckExecutionList.vue} | 4 ++-- ...countPushList.vue => AccountCheckList.vue} | 14 +++++++----- .../pam/AccountCheck/AccountRiskSummary.vue | 2 +- src/views/pam/AccountCheck/index.vue | 22 ++++++++++++------- 15 files changed, 44 insertions(+), 39 deletions(-) rename src/views/pam/AccountCheck/{AccountPushCreateUpdate.vue => AccountCheckCreateUpdate.vue} (91%) rename src/views/pam/AccountCheck/{AccountPushDetail => AccountCheckDetail}/AccountPushInfo.vue (100%) rename src/views/pam/AccountCheck/{AccountPushDetail => AccountCheckDetail}/index.vue (94%) rename src/views/pam/AccountCheck/{AccountPushExecutionDetail => AccountCheckExecutionDetail}/AccountPushExecutionInfo.vue (100%) rename src/views/pam/AccountCheck/{AccountPushExecutionDetail => AccountCheckExecutionDetail}/AccountPushExecutionTaskList.vue (100%) rename src/views/pam/AccountCheck/{AccountPushExecutionDetail => AccountCheckExecutionDetail}/index.vue (100%) rename src/views/pam/AccountCheck/{AccountPushExecutionList.vue => AccountCheckExecutionList.vue} (96%) rename src/views/pam/AccountCheck/{AccountPushList.vue => AccountCheckList.vue} (88%) diff --git a/src/router/pam/security.js b/src/router/pam/security.js index 123ff8752..7fd16893c 100644 --- a/src/router/pam/security.js +++ b/src/router/pam/security.js @@ -10,7 +10,7 @@ export default [ app: 'accounts', name: 'BaseAccountRisk', icon: 'scan', - resource: 'pushaccountautomation' + resource: 'accountcheckautomation' }, children: [ { @@ -19,8 +19,16 @@ export default [ name: 'AccountCheckSummary', meta: { title: i18n.t('账号检查'), - menuTitle: i18n.t('账号检查'), - permissions: ['accounts.view_pushaccountautomation'] + menuTitle: i18n.t('账号检查') + } + }, + { + path: 'create', + component: () => import('@/views/pam/AccountCheck/AccountCheckCreateUpdate.vue'), + name: 'AccountCheckCreate', + hidden: true, + meta: { + title: i18n.t('AccountCheckCreate') } } ] diff --git a/src/router/pam/service.js b/src/router/pam/service.js index 715979541..bf9411d5e 100644 --- a/src/router/pam/service.js +++ b/src/router/pam/service.js @@ -51,7 +51,7 @@ export default [ { path: ':id', component: () => import('@/views/accounts/AccountPush/AccountPushDetail/index.vue'), - name: 'AccountPushDetail', + name: 'AccountCheckDetail', hidden: true, meta: { title: i18n.t('AccountPushList'), @@ -73,7 +73,7 @@ export default [ { path: 'executions/:id', component: () => import('@/views/accounts/AccountPush/AccountPushExecutionDetail/index.vue'), - name: 'AccountPushExecutionDetail', + name: 'AccountCheckExecutionDetail', hidden: true, meta: { title: i18n.t('ExecutionDetail'), diff --git a/src/views/accounts/AccountPush/AccountPushDetail/index.vue b/src/views/accounts/AccountPush/AccountPushDetail/index.vue index b3496cf54..91bc0806e 100644 --- a/src/views/accounts/AccountPush/AccountPushDetail/index.vue +++ b/src/views/accounts/AccountPush/AccountPushDetail/index.vue @@ -19,7 +19,7 @@ export default { return { plan: { name: '', username: '', comment: '' }, config: { - titlePrefix: this.$t('AccountPushDetail'), + titlePrefix: this.$t('AccountCheckDetail'), activeMenu: 'AccountPushInfo', url: '/api/v1/accounts/push-account-automations', submenu: [ diff --git a/src/views/accounts/AccountPush/AccountPushExecutionList.vue b/src/views/accounts/AccountPush/AccountPushExecutionList.vue index c36d9e4e3..f4e9ba1ff 100644 --- a/src/views/accounts/AccountPush/AccountPushExecutionList.vue +++ b/src/views/accounts/AccountPush/AccountPushExecutionList.vue @@ -46,7 +46,7 @@ export default { formatterArgs: { getTitle: ({ row }) => row.snapshot.name, getRoute: ({ row }) => ({ - name: 'AccountPushDetail', + name: 'AccountCheckDetail', params: { id: row.automation } }) }, @@ -94,7 +94,7 @@ export default { type: 'info', can: this.$hasPerm('accounts.view_pushaccountexecution'), callback: function({ row }) { - return this.$router.push({ name: 'AccountPushExecutionDetail', params: { id: row.id }}) + return this.$router.push({ name: 'AccountCheckExecutionDetail', params: { id: row.id }}) } } ] diff --git a/src/views/accounts/AccountPush/AccountPushList.vue b/src/views/accounts/AccountPush/AccountPushList.vue index 575b585a6..2500676df 100644 --- a/src/views/accounts/AccountPush/AccountPushList.vue +++ b/src/views/accounts/AccountPush/AccountPushList.vue @@ -32,7 +32,7 @@ export default { name: { formatter: DetailFormatter, formatterArgs: { - route: 'AccountPushDetail' + route: 'AccountCheckDetail' } }, accounts: { diff --git a/src/views/pam/AccountCheck/AccountPushCreateUpdate.vue b/src/views/pam/AccountCheck/AccountCheckCreateUpdate.vue similarity index 91% rename from src/views/pam/AccountCheck/AccountPushCreateUpdate.vue rename to src/views/pam/AccountCheck/AccountCheckCreateUpdate.vue index 39c095290..74ff81bc0 100644 --- a/src/views/pam/AccountCheck/AccountPushCreateUpdate.vue +++ b/src/views/pam/AccountCheck/AccountCheckCreateUpdate.vue @@ -27,22 +27,11 @@ export default { secret_type: 'password', secret_strategy: 'specific' }, - url: '/api/v1/accounts/push-account-automations/', + url: '/api/v1/accounts/check-account-automations/', encryptedFields: ['secret'], fields: [ [this.$t('Basic'), ['name']], [this.$t('Asset'), ['assets', 'nodes']], - [ - this.$t('Account'), - [ - 'accounts', 'secret_strategy', 'secret_type', 'secret', - 'password_rules', 'ssh_key_change_strategy', 'ssh_key', - 'passphrase' - ] - ], - [ - this.$t('Automations'), ['params'] - ], [this.$t('Periodic'), ['is_periodic', 'interval', 'crontab']], [this.$t('Other'), ['is_active', 'comment']] ], diff --git a/src/views/pam/AccountCheck/AccountPushDetail/AccountPushInfo.vue b/src/views/pam/AccountCheck/AccountCheckDetail/AccountPushInfo.vue similarity index 100% rename from src/views/pam/AccountCheck/AccountPushDetail/AccountPushInfo.vue rename to src/views/pam/AccountCheck/AccountCheckDetail/AccountPushInfo.vue diff --git a/src/views/pam/AccountCheck/AccountPushDetail/index.vue b/src/views/pam/AccountCheck/AccountCheckDetail/index.vue similarity index 94% rename from src/views/pam/AccountCheck/AccountPushDetail/index.vue rename to src/views/pam/AccountCheck/AccountCheckDetail/index.vue index 983b7d479..208c0683f 100644 --- a/src/views/pam/AccountCheck/AccountPushDetail/index.vue +++ b/src/views/pam/AccountCheck/AccountCheckDetail/index.vue @@ -19,7 +19,7 @@ export default { return { plan: { name: '', username: '', comment: '' }, config: { - titlePrefix: this.$t('AccountPushDetail'), + titlePrefix: this.$t('AccountCheckDetail'), activeMenu: 'AccountPushInfo', url: '/api/v1/accounts/push-account-automations', submenu: [ diff --git a/src/views/pam/AccountCheck/AccountPushExecutionDetail/AccountPushExecutionInfo.vue b/src/views/pam/AccountCheck/AccountCheckExecutionDetail/AccountPushExecutionInfo.vue similarity index 100% rename from src/views/pam/AccountCheck/AccountPushExecutionDetail/AccountPushExecutionInfo.vue rename to src/views/pam/AccountCheck/AccountCheckExecutionDetail/AccountPushExecutionInfo.vue diff --git a/src/views/pam/AccountCheck/AccountPushExecutionDetail/AccountPushExecutionTaskList.vue b/src/views/pam/AccountCheck/AccountCheckExecutionDetail/AccountPushExecutionTaskList.vue similarity index 100% rename from src/views/pam/AccountCheck/AccountPushExecutionDetail/AccountPushExecutionTaskList.vue rename to src/views/pam/AccountCheck/AccountCheckExecutionDetail/AccountPushExecutionTaskList.vue diff --git a/src/views/pam/AccountCheck/AccountPushExecutionDetail/index.vue b/src/views/pam/AccountCheck/AccountCheckExecutionDetail/index.vue similarity index 100% rename from src/views/pam/AccountCheck/AccountPushExecutionDetail/index.vue rename to src/views/pam/AccountCheck/AccountCheckExecutionDetail/index.vue diff --git a/src/views/pam/AccountCheck/AccountPushExecutionList.vue b/src/views/pam/AccountCheck/AccountCheckExecutionList.vue similarity index 96% rename from src/views/pam/AccountCheck/AccountPushExecutionList.vue rename to src/views/pam/AccountCheck/AccountCheckExecutionList.vue index 38322c1d3..1357c914d 100644 --- a/src/views/pam/AccountCheck/AccountPushExecutionList.vue +++ b/src/views/pam/AccountCheck/AccountCheckExecutionList.vue @@ -46,7 +46,7 @@ export default { formatterArgs: { getTitle: ({ row }) => row.snapshot.name, getRoute: ({ row }) => ({ - name: 'AccountPushDetail', + name: 'AccountCheckDetail', params: { id: row.automation } }) }, @@ -94,7 +94,7 @@ export default { type: 'info', can: this.$hasPerm('accounts.view_pushaccountexecution'), callback: function({ row }) { - return this.$router.push({ name: 'AccountPushExecutionDetail', params: { id: row.id }}) + return this.$router.push({ name: 'AccountCheckExecutionDetail', params: { id: row.id }}) } } ] diff --git a/src/views/pam/AccountCheck/AccountPushList.vue b/src/views/pam/AccountCheck/AccountCheckList.vue similarity index 88% rename from src/views/pam/AccountCheck/AccountPushList.vue rename to src/views/pam/AccountCheck/AccountCheckList.vue index 575b585a6..d432eb498 100644 --- a/src/views/pam/AccountCheck/AccountPushList.vue +++ b/src/views/pam/AccountCheck/AccountCheckList.vue @@ -16,10 +16,10 @@ export default { const vm = this return { tableConfig: { - url: '/api/v1/accounts/push-account-automations/', + url: '/api/v1/accounts/check-account-automations/', columns: [ - 'name', 'accounts', 'secret_strategy', 'is_periodic', - 'periodic_display', 'executed_amount', 'is_active', 'actions' + 'name', 'assets', 'accounts', 'secret_strategy', 'is_periodic', + 'periodic_display', 'is_active', 'actions' ], columnsShow: { min: ['name', 'actions'], @@ -32,7 +32,7 @@ export default { name: { formatter: DetailFormatter, formatterArgs: { - route: 'AccountPushDetail' + route: 'AccountCheckDetail' } }, accounts: { @@ -87,7 +87,7 @@ export default { title: vm.$t('Execute'), name: 'execute', can: ({ row }) => { - return row.is_active && vm.$hasPerm('accounts.add_pushaccountexecution') + return row.is_active && vm.$hasPerm('accounts.add_accountcheckautomation') }, type: 'info', callback: function({ row }) { @@ -110,7 +110,9 @@ export default { headerActions: { hasRefresh: true, hasExport: false, - hasImport: false + hasImport: false, + createRoute: 'AccountCheckCreate', + canCreate: vm.$hasPerm('accounts.add_accountcheckautomation') } } } diff --git a/src/views/pam/AccountCheck/AccountRiskSummary.vue b/src/views/pam/AccountCheck/AccountRiskSummary.vue index 607d1a285..181ab07e7 100644 --- a/src/views/pam/AccountCheck/AccountRiskSummary.vue +++ b/src/views/pam/AccountCheck/AccountRiskSummary.vue @@ -30,7 +30,7 @@ export default { name: { formatter: DetailFormatter, formatterArgs: { - route: 'AccountPushDetail' + route: 'AccountCheckDetail' } }, risk_summary: { diff --git a/src/views/pam/AccountCheck/index.vue b/src/views/pam/AccountCheck/index.vue index 64fdd4bc1..d271eb44c 100644 --- a/src/views/pam/AccountCheck/index.vue +++ b/src/views/pam/AccountCheck/index.vue @@ -6,14 +6,14 @@ import { TabPage } from '@/layout/components' export default { - name: 'Index', + name: 'AccountCheck', components: { TabPage }, data() { return { config: { - activeMenu: 'AccountPushList', + activeMenu: 'AccountRisks', submenu: [ { title: this.$t('检查结果'), @@ -21,12 +21,18 @@ export default { hidden: !this.$hasPerm('accounts.view_accountrisk'), component: () => import('@/views/pam/AccountCheck/AccountRiskList.vue') }, - { - title: this.$t('检查任务'), - name: 'AccountCheckTask', - hidden: !this.$hasPerm('accounts.view_pushaccountexecution'), - component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue') - }, + // { + // title: this.$t('检查任务'), + // name: 'AccountCheckTask', + // hidden: !this.$hasPerm('accounts.view_accountcheckautomation'), + // component: () => import('./AccountCheckList.vue') + // }, + // { + // title: this.$t('执行历史'), + // name: 'AccountCheckExecution', + // hidden: !this.$hasPerm('accounts.view_accountcheckautomation'), + // component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue') + // }, { title: this.$t('检查引擎'), name: 'AccountCheckEngine',