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

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,7 +7,7 @@
<script>
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 { openTaskPage } from '@/utils/jms'
@@ -37,8 +37,13 @@ export default {
columnsMeta: {
name: {
width: '140px',
formatter: DetailFormatter,
formatterArgs: {
can: true
can: true,
getRoute: ({ row }) => ({
name: 'JobDetail',
params: { id: row.id }
})
}
},
type: {