From 2cb1ae1ab767c5f6f4e14c6fabdeefe99cad6e37 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Wed, 12 Jun 2024 15:25:58 +0800 Subject: [PATCH] perf: Account task filter optimization --- .../AccountBackupExecutionList.vue | 12 +++++++++--- .../AccountChangeSecretExecutionList.vue | 12 +++++++++--- .../accounts/AccountGather/TaskCreateUpdate.vue | 2 -- .../AccountGather/TaskDetail/TaskExecutionList.vue | 10 ++++++++-- .../AccountPush/AccountPushExecutionList.vue | 14 ++++++++++---- src/views/ops/Job/index.vue | 9 +++++++-- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue b/src/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue index f11630fac..6168e7a68 100644 --- a/src/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue +++ b/src/views/accounts/AccountBackup/AccountBackupDetail/AccountBackupExecution/AccountBackupExecutionList.vue @@ -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 {row.plan} + } + }, + account_backup_name: { label: this.$t('DisplayName'), formatter: DetailFormatter, formatterArgs: { diff --git a/src/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue b/src/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue index a24d75ecc..0e4d4a924 100644 --- a/src/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue +++ b/src/views/accounts/AccountChangeSecret/AccountChangeSecretDetail/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue @@ -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 {row.automation} + } + }, + change_secret_name: { label: this.$t('DisplayName'), formatter: DetailFormatter, formatterArgs: { diff --git a/src/views/accounts/AccountGather/TaskCreateUpdate.vue b/src/views/accounts/AccountGather/TaskCreateUpdate.vue index da45bef4e..15df56287 100644 --- a/src/views/accounts/AccountGather/TaskCreateUpdate.vue +++ b/src/views/accounts/AccountGather/TaskCreateUpdate.vue @@ -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: [], diff --git a/src/views/accounts/AccountGather/TaskDetail/TaskExecutionList.vue b/src/views/accounts/AccountGather/TaskDetail/TaskExecutionList.vue index 8f6d9f5a6..08d6f04ff 100644 --- a/src/views/accounts/AccountGather/TaskDetail/TaskExecutionList.vue +++ b/src/views/accounts/AccountGather/TaskDetail/TaskExecutionList.vue @@ -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 {row.automation} + } + }, + account_gather_name: { label: this.$t('DisplayName'), formatter: DetailFormatter, formatterArgs: { diff --git a/src/views/accounts/AccountPush/AccountPushExecutionList.vue b/src/views/accounts/AccountPush/AccountPushExecutionList.vue index d0b418042..b5f15424a 100644 --- a/src/views/accounts/AccountPush/AccountPushExecutionList.vue +++ b/src/views/accounts/AccountPush/AccountPushExecutionList.vue @@ -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 {row.automation} + } + }, + 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']) diff --git a/src/views/ops/Job/index.vue b/src/views/ops/Job/index.vue index 643a9d32b..26bfc4a65 100644 --- a/src/views/ops/Job/index.vue +++ b/src/views/ops/Job/index.vue @@ -7,7 +7,7 @@