perf: update execution

This commit is contained in:
ibuler
2025-01-15 10:26:44 +08:00
parent 3d1a2d6833
commit e2904acff6
8 changed files with 41 additions and 16 deletions

View File

@@ -86,8 +86,9 @@ export default {
extraActions: [
{
title: vm.$t('Execute'),
order: 1,
name: 'execute',
type: 'info',
type: 'primary',
can: this.$hasPerm('accounts.add_accountbackupexecution'),
callback: function({ row }) {
this.$axios.post(

View File

@@ -83,10 +83,11 @@ export default {
{
title: vm.$t('Execute'),
name: 'execute',
order: 1,
can: ({ row }) => {
return row.is_active && vm.$hasPerm('accounts.add_changesecretexecution')
},
type: 'info',
type: 'primary',
disabled: ({ row }) => !row.is_active,
callback: function({ row }) {
this.$axios.post(

View File

@@ -91,7 +91,8 @@ export default {
{
title: vm.$t('Execute'),
name: 'execute',
type: 'info',
type: 'primary',
order: 1,
can: vm.$hasPerm('accounts.add_gatheraccountsexecution'),
callback: function(data) {
this.$axios.post(

View File

@@ -87,10 +87,11 @@ export default {
{
title: vm.$t('Execute'),
name: 'execute',
order: 1,
type: 'primary',
can: ({ row }) => {
return row.is_active && vm.$hasPerm('accounts.add_pushaccountexecution')
},
type: 'info',
callback: function({ row }) {
this.$axios.post(
`/api/v1/accounts/push-account-executions/`,

View File

@@ -112,8 +112,8 @@ export default {
{
title: vm.$t('Execute'),
order: 1,
name: 'execute',
type: 'primary',
name: 'execute',
can: ({ row }) => {
return row.is_active && vm.$hasPerm('accounts.add_accountcheckautomation')
},

View File

@@ -90,7 +90,7 @@ export default {
return riskActions.reduce((acc, cur) => {
acc[cur.name] = cur
return acc
}, { 'ignore': { label: this.$t('Ignore') }})
}, {})
},
iRows() {
if (this.rows.length === 0) {
@@ -124,20 +124,26 @@ export default {
this.$emit('ignore', { comment: this.comment })
},
getDetailIcon(detail) {
if (detail.status === '1') {
return 'el-icon-check'
} else if (detail.status === '0') {
return 'el-icon-close'
switch (detail.status) {
case '1':
return 'el-icon-check'
case '2':
return 'el-icon-close-notification'
default:
return ''
}
},
getDetailType(detail) {
if (detail.type !== 'process') {
return 'warning'
}
if (detail.status === '1') {
return 'primary'
} else {
return 'danger'
switch (detail.action) {
case 'ignore':
return 'danger'
case 'reopen':
return 'primary'
default:
return 'success'
}
},
handleDetail(row, detail) {

View File

@@ -49,6 +49,14 @@ export const riskActions = [
return risks.includes(this.row.risk.value) && await checkUserExist.call(this)
}
},
{
name: 'view_password',
label: i18n.t('View Password'),
has: async function() {
const risks = ['weak_password', 'leaked_password', 'repeated_password']
return risks.includes(this.row.risk.value)
}
},
// {
// name: 'addPrivilegedAccount',
// label: i18n.t('Add Privileged Account'),
@@ -63,5 +71,10 @@ export const riskActions = [
name: 'review',
label: i18n.t('Review'),
has: ['group_changed', 'sudo_changed', 'authorized_key_changed', 'account_deleted', 'others']
},
{
name: 'ignore',
label: i18n.t('Ignore'),
has: false
}
]

View File

@@ -22,13 +22,12 @@
</el-button>
</el-tooltip>
</span>
<el-tooltip v-else :content="$t('Detail')" :open-delay="400" class="platform-status">
<el-tooltip v-else :content="iLabel" :open-delay="400" class="platform-status">
<el-button size="mini" type="text" @click="showDetail">
<span class="detail-icon">
<i v-if="iValue === '1'" class="fa fa-check-circle color-primary" />
<svg-icon v-else icon-class="ignore" />
</span>
{{ iLabel }}
</el-button>
</el-tooltip>
<ReviewDraw
@@ -111,6 +110,9 @@ export default {
},
showDetail() {
this.reviewDrawer = true
},
handleViewSecret() {
},
handleReview() {
this.reviewDrawer = true