Merge pull request #4025 from jumpserver/pr@v4@account

perf: Account task filter optimization
This commit is contained in:
feng626
2024-06-12 15:30:30 +08:00
committed by GitHub
6 changed files with 43 additions and 16 deletions

View File

@@ -24,17 +24,23 @@ export default {
tableConfig: { tableConfig: {
url: '/api/v1/accounts/account-backup-plan-executions/', url: '/api/v1/accounts/account-backup-plan-executions/',
columns: [ columns: [
'AccountBackupName', 'timedelta', 'trigger', 'date_start', 'automation', 'account_backup_name', 'timedelta', 'trigger', 'date_start',
'is_success', 'reason', 'actions' 'is_success', 'reason', 'actions'
], ],
columnsShow: { columnsShow: {
default: [ default: [
'AccountBackupName', 'timedelta', 'date_start', 'automation', 'account_backup_name', 'timedelta', 'date_start',
'is_success', 'reason', 'actions' 'is_success', 'reason', 'actions'
] ]
}, },
columnsMeta: { columnsMeta: {
'AccountBackupName': { automation: {
label: this.$t('TaskID'),
formatter: function(row) {
return <span>{row.plan}</span>
}
},
account_backup_name: {
label: this.$t('DisplayName'), label: this.$t('DisplayName'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {

View File

@@ -24,17 +24,23 @@ export default {
tableConfig: { tableConfig: {
url: '/api/v1/accounts/change-secret-executions', url: '/api/v1/accounts/change-secret-executions',
columns: [ columns: [
'ChangeSecretName', 'asset_amount', 'node_amount', 'status', 'automation', 'change_secret_name', 'asset_amount', 'node_amount', 'status',
'trigger', 'date_start', 'date_finished', 'actions' 'trigger', 'date_start', 'date_finished', 'actions'
], ],
columnsShow: { columnsShow: {
default: [ default: [
'ChangeSecretName', 'asset_amount', 'node_amount', 'status', 'automation', 'change_secret_name', 'status',
'date_start', 'date_finished', 'actions' 'date_start', 'date_finished', 'actions'
] ]
}, },
columnsMeta: { columnsMeta: {
'ChangeSecretName': { automation: {
label: this.$t('TaskID'),
formatter: function(row) {
return <span>{row.automation}</span>
}
},
change_secret_name: {
label: this.$t('DisplayName'), label: this.$t('DisplayName'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {

View File

@@ -30,7 +30,6 @@ export default {
crontab, crontab,
interval, interval,
assets: { assets: {
label: this.$tc('assets.Asset'),
el: { el: {
multiple: true, multiple: true,
value: [], value: [],
@@ -43,7 +42,6 @@ export default {
} }
}, },
nodes: { nodes: {
label: this.$tc('Node'),
el: { el: {
multiple: true, multiple: true,
value: [], value: [],

View File

@@ -24,11 +24,17 @@ export default {
tableConfig: { tableConfig: {
url: '/api/v1/accounts/gather-account-executions/', url: '/api/v1/accounts/gather-account-executions/',
columns: [ columns: [
'AccountGatherName', 'status', 'date_start', 'automation', 'account_gather_name', 'status', 'date_start',
'date_finished', 'actions' 'date_finished', 'actions'
], ],
columnsMeta: { columnsMeta: {
'AccountGatherName': { automation: {
label: this.$t('TaskID'),
formatter: function(row) {
return <span>{row.automation}</span>
}
},
account_gather_name: {
label: this.$t('DisplayName'), label: this.$t('DisplayName'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {

View File

@@ -24,17 +24,23 @@ export default {
tableConfig: { tableConfig: {
url: '/api/v1/accounts/push-account-executions/?' + `${this.object.id ? 'automation_id=' + this.object.id : ''}`, url: '/api/v1/accounts/push-account-executions/?' + `${this.object.id ? 'automation_id=' + this.object.id : ''}`,
columns: [ columns: [
'PushUserName', 'asset_amount', 'node_amount', 'status', 'automation', 'push_user_name', 'asset_amount', 'node_amount', 'status',
'trigger', 'date_start', 'date_finished', 'actions' 'trigger', 'date_start', 'date_finished', 'actions'
], ],
columnsShow: { columnsShow: {
default: [ default: [
'PushUserName', 'asset_amount', 'node_amount', 'status', 'automation', 'push_user_name', 'status',
'date_start', 'date_finished', 'actions' 'date_start', 'date_finished', 'actions'
] ]
}, },
columnsMeta: { columnsMeta: {
'PushUserName': { automation: {
label: this.$t('TaskID'),
formatter: function(row) {
return <span>{row.automation}</span>
}
},
push_user_name: {
label: this.$t('DisplayName'), label: this.$t('DisplayName'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
@@ -76,7 +82,7 @@ export default {
{ {
name: 'log', name: 'log',
type: 'primary', type: 'primary',
can: 'accounts.view_pushaccountexecution', can: this.$hasPerm('accounts.view_pushaccountexecution'),
title: this.$t('Log'), title: this.$t('Log'),
callback: function({ row }) { callback: function({ row }) {
openTaskPage(row['id']) openTaskPage(row['id'])

View File

@@ -7,7 +7,7 @@
<script> <script>
import GenericListPage from '@/layout/components/GenericListPage' import GenericListPage from '@/layout/components/GenericListPage'
import { ActionsFormatter, DateFormatter } from '@/components/Table/TableFormatters' import { ActionsFormatter, DateFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
import JobRunDialog from '@/views/ops/Job/JobRunDialog' import JobRunDialog from '@/views/ops/Job/JobRunDialog'
import { openTaskPage } from '@/utils/jms' import { openTaskPage } from '@/utils/jms'
@@ -37,8 +37,13 @@ export default {
columnsMeta: { columnsMeta: {
name: { name: {
width: '140px', width: '140px',
formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
can: true can: true,
getRoute: ({ row }) => ({
name: 'JobDetail',
params: { id: row.id }
})
} }
}, },
type: { type: {