perf: update accout check

This commit is contained in:
ibuler
2024-11-13 18:46:24 +08:00
parent 823c26aa5e
commit e18726efc2
15 changed files with 44 additions and 39 deletions

View File

@@ -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')
}
}
]

View File

@@ -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'),

View File

@@ -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: [

View File

@@ -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 }})
}
}
]

View File

@@ -32,7 +32,7 @@ export default {
name: {
formatter: DetailFormatter,
formatterArgs: {
route: 'AccountPushDetail'
route: 'AccountCheckDetail'
}
},
accounts: {

View File

@@ -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']]
],

View File

@@ -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: [

View File

@@ -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 }})
}
}
]

View File

@@ -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')
}
}
}

View File

@@ -30,7 +30,7 @@ export default {
name: {
formatter: DetailFormatter,
formatterArgs: {
route: 'AccountPushDetail'
route: 'AccountCheckDetail'
}
},
risk_summary: {

View File

@@ -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',