From d5099c3a047c480388042c84ea0d6a3e75bf627c Mon Sep 17 00:00:00 2001 From: w940853815 <940853815@qq.com> Date: Wed, 19 Feb 2025 15:33:55 +0800 Subject: [PATCH] perf: add update actions and detail formatters to various components --- .../Table/DrawerListTable/index.vue | 3 +++ src/views/ops/Execution/index.vue | 16 ++++--------- src/views/ops/Job/components/Adhoc.vue | 6 +++++ src/views/ops/Job/components/PlayBook.vue | 6 +++++ src/views/sessions/CommandList/BaseList.vue | 3 +-- .../OnlineSession/OnlineSessionList.vue | 23 +++++++++++-------- 6 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/components/Table/DrawerListTable/index.vue b/src/components/Table/DrawerListTable/index.vue index 38461db34..ac74c711d 100644 --- a/src/components/Table/DrawerListTable/index.vue +++ b/src/components/Table/DrawerListTable/index.vue @@ -88,6 +88,9 @@ export default { if (!actions.onCreate) { actions.onCreate = this.onCreate } + if (!actions.onUpdate) { + actions.onUpdate = this.onUpdate + } return actions }, iTableConfig() { diff --git a/src/views/ops/Execution/index.vue b/src/views/ops/Execution/index.vue index 1c089a31a..681e24816 100644 --- a/src/views/ops/Execution/index.vue +++ b/src/views/ops/Execution/index.vue @@ -9,6 +9,7 @@ import { GenericListPage } from '@/layout/components' import { openTaskPage } from '@/utils/jms' import ExecutionDetailDialog from '@/views/ops/Execution/ExecutionDetail' +import detailFormatter from '@/components/Table/TableFormatters/DetailFormatter.vue' export default { components: { @@ -34,8 +35,10 @@ export default { }, columnsMeta: { id: { - formatter(row) { - return row.id.slice(0, 8) + formatter: detailFormatter, + formatterArgs: { + drawer: true, + route: 'ExecutionDetail' } }, job: { @@ -77,15 +80,6 @@ export default { hasDelete: false, hasClone: false, extraActions: [ - { - title: this.$t('Detail'), - name: 'detail', - type: 'primary', - can: true, - callback: ({ row }) => { - this.$router.push({ name: 'ExecutionDetail', params: { id: row.id }}) - } - }, { title: this.$t('Output'), name: 'logging', diff --git a/src/views/ops/Job/components/Adhoc.vue b/src/views/ops/Job/components/Adhoc.vue index cfc86bbbf..e02571ef1 100644 --- a/src/views/ops/Job/components/Adhoc.vue +++ b/src/views/ops/Job/components/Adhoc.vue @@ -121,6 +121,12 @@ export default { }) vm.$refs.ListTable.onCreate() }, + onUpdate: () => { + vm.$router.push({ + query: { _type: 'adhoc' } + }) + vm.$refs.ListTable.onUpdate() + }, hasRefresh: true, hasExport: false, hasImport: false diff --git a/src/views/ops/Job/components/PlayBook.vue b/src/views/ops/Job/components/PlayBook.vue index d766779d0..9b7fbe174 100644 --- a/src/views/ops/Job/components/PlayBook.vue +++ b/src/views/ops/Job/components/PlayBook.vue @@ -126,6 +126,12 @@ export default { vm.$refs.ListTable.onCreate() } }, + onUpdate: () => { + vm.$router.push({ + query: { _type: 'playbook' } + }) + vm.$refs.ListTable.onUpdate() + }, showJobRunDialog: false } }, diff --git a/src/views/sessions/CommandList/BaseList.vue b/src/views/sessions/CommandList/BaseList.vue index f86c807e9..082102b61 100644 --- a/src/views/sessions/CommandList/BaseList.vue +++ b/src/views/sessions/CommandList/BaseList.vue @@ -82,8 +82,7 @@ export default { session: { formatter: DetailFormatter, formatterArgs: { - openInNewPage: true, - removeColorOnClick: true, + drawer: true, can: this.$hasPerm('terminal.view_session'), getTitle() { return vm.$t('Goto') diff --git a/src/views/sessions/OnlineSession/OnlineSessionList.vue b/src/views/sessions/OnlineSession/OnlineSessionList.vue index 2a6bc2783..18c70b87f 100644 --- a/src/views/sessions/OnlineSession/OnlineSessionList.vue +++ b/src/views/sessions/OnlineSession/OnlineSessionList.vue @@ -10,6 +10,7 @@