mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-19 07:18:11 +00:00
perf: 统一 automations 历史
This commit is contained in:
parent
f730611102
commit
a8a1a56f3d
@ -85,7 +85,7 @@ export default {
|
|||||||
disabled() {
|
disabled() {
|
||||||
let can = this.formatterArgs.can
|
let can = this.formatterArgs.can
|
||||||
if (typeof can === 'function') {
|
if (typeof can === 'function') {
|
||||||
can = can(this.col)
|
can = can({ col: this.col, row: this.row })
|
||||||
}
|
}
|
||||||
return !can
|
return !can
|
||||||
},
|
},
|
||||||
|
@ -69,6 +69,8 @@ export const is_periodic = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const taskStatusFormatterMeta = {}
|
||||||
|
|
||||||
export const periodicMeta = {
|
export const periodicMeta = {
|
||||||
is_periodic,
|
is_periodic,
|
||||||
interval,
|
interval,
|
||||||
|
@ -16,7 +16,7 @@ router.beforeEach(async(to, from, next) => {
|
|||||||
try {
|
try {
|
||||||
await store.dispatch('common/cleanDrawerActionMeta')
|
await store.dispatch('common/cleanDrawerActionMeta')
|
||||||
await startup({ to, from, next })
|
await startup({ to, from, next })
|
||||||
if (to.name !== from.name) {
|
if (to.name && from.name && to.name !== from.name) {
|
||||||
await beforeRouteChange(to, from, next)
|
await beforeRouteChange(to, from, next)
|
||||||
}
|
}
|
||||||
next()
|
next()
|
||||||
|
@ -28,7 +28,7 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'create',
|
path: 'create',
|
||||||
component: () => import('@/views/accounts/AccountDiscover/TaskCreateUpdate'),
|
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverTaskCreateUpdate.vue'),
|
||||||
name: 'AccountDiscoverTaskCreate',
|
name: 'AccountDiscoverTaskCreate',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
@ -50,7 +50,7 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':id/update',
|
path: ':id/update',
|
||||||
component: () => import('@/views/accounts/AccountDiscover/TaskCreateUpdate'),
|
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverTaskCreateUpdate.vue'),
|
||||||
name: 'AccountDiscoverTaskUpdate',
|
name: 'AccountDiscoverTaskUpdate',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
@ -62,7 +62,7 @@ export default [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'executions',
|
path: 'executions',
|
||||||
component: () => import('@/views/accounts/AccountDiscover/TaskExecutionList.vue'),
|
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverExecutionList.vue'),
|
||||||
name: 'AccountDiscoverTaskExecutionList',
|
name: 'AccountDiscoverTaskExecutionList',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
|
@ -1,140 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<BaseExecutionList
|
||||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
:automation-route="automationRoute"
|
||||||
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
:detail-route="detailRoute"
|
||||||
</div>
|
:resource="resource"
|
||||||
|
:url="url"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
import BaseExecutionList from '@/views/accounts/Automation/BaseExecutionList.vue'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
|
||||||
import ReportDialog from '@/components/Dialog/ReportDialog.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountBackupExecutionList',
|
name: 'AccountBackupExecutionList',
|
||||||
components: {
|
components: {
|
||||||
GenericListTable,
|
BaseExecutionList
|
||||||
ReportDialog
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
object: {
|
|
||||||
type: Object,
|
|
||||||
required: false,
|
|
||||||
default: () => ({})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const vm = this
|
|
||||||
return {
|
return {
|
||||||
visible: false,
|
url: '/api/v1/accounts/account-backup-plan-executions/',
|
||||||
reportUrl: '',
|
detailRoute: 'AccountBackupExecutionDetail',
|
||||||
tableConfig: {
|
automationRoute: 'AccountBackupDetail',
|
||||||
url: '/api/v1/accounts/account-backup-plan-executions/',
|
resource: 'backupaccountexecution'
|
||||||
columns: [
|
|
||||||
'automation', 'backup_name', 'trigger',
|
|
||||||
'date_start', 'date_finished', 'duration', 'actions'
|
|
||||||
],
|
|
||||||
columnsShow: {
|
|
||||||
default: [
|
|
||||||
'automation', 'backup_name', 'trigger',
|
|
||||||
'date_start', 'date_finished', 'actions'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
columnsMeta: {
|
|
||||||
automation: {
|
|
||||||
label: this.$t('ID'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
route: 'AccountBackupExecutionDetail',
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'AccountBackupExecutionDetail',
|
|
||||||
params: { id: row.id }
|
|
||||||
}),
|
|
||||||
getDrawerTitle: ({ row }) => row.id,
|
|
||||||
getTitle: ({ row }) => row.id.slice(0, 8),
|
|
||||||
drawer: true,
|
|
||||||
can: this.$hasPerm('accounts.view_backupaccountexecution')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
backup_name: {
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
drawer: true,
|
|
||||||
getTitle: ({ row }) => row.automation.name,
|
|
||||||
getDrawerTitle: ({ row }) => row.automation.name,
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'AccountBackupDetail',
|
|
||||||
params: { id: row.automation.id }
|
|
||||||
})
|
|
||||||
},
|
|
||||||
id: ({ row }) => row.automation
|
|
||||||
},
|
|
||||||
duration: {
|
|
||||||
label: this.$t('TimeDelta'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return row.duration + 's'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
formatterArgs: {
|
|
||||||
hasDelete: false,
|
|
||||||
hasUpdate: false,
|
|
||||||
hasClone: false,
|
|
||||||
extraActions: [
|
|
||||||
{
|
|
||||||
name: 'log',
|
|
||||||
type: 'primary',
|
|
||||||
can: this.$hasPerm('accounts.view_backupaccountexecution'),
|
|
||||||
title: this.$t('Log'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
openTaskPage(row['id'])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'report',
|
|
||||||
title: this.$t('Report'),
|
|
||||||
type: 'success',
|
|
||||||
can: this.$hasPerm('accounts.view_backupaccountexecution'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
vm.visible = true
|
|
||||||
vm.reportUrl = `/api/v1/accounts/account-backup-plan-executions/${row.id}/report/`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headerActions: {
|
|
||||||
searchConfig: {
|
|
||||||
getUrlQuery: true,
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: this.$t('TaskID'),
|
|
||||||
value: 'automation_id'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
value: 'automation__name'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
hasRefresh: true,
|
|
||||||
hasRightActions: true,
|
|
||||||
hasLeftActions: false,
|
|
||||||
hasMoreActions: false,
|
|
||||||
hasExport: false,
|
|
||||||
hasImport: false,
|
|
||||||
hasCreate: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
const plan_id = this.$route.query.plan_id
|
|
||||||
if (plan_id !== undefined) {
|
|
||||||
this.tableConfig.url = `${this.tableConfig.url}?plan_id=${plan_id}`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,156 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<BaseExecutionList
|
||||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
:automation-route="automationRoute"
|
||||||
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
:detail-route="detailRoute"
|
||||||
</div>
|
:resource="resource"
|
||||||
|
:url="url"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
import BaseExecutionList from '@/views/accounts/Automation/BaseExecutionList.vue'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
|
||||||
import ReportDialog from '@/components/Dialog/ReportDialog.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountChangeSecretExecutionList',
|
name: 'AccountChangeSecretExecutionList',
|
||||||
components: {
|
components: {
|
||||||
ReportDialog,
|
BaseExecutionList
|
||||||
GenericListTable
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const vm = this
|
|
||||||
return {
|
return {
|
||||||
visible: false,
|
url: '/api/v1/accounts/change-secret-executions/',
|
||||||
reportUrl: '',
|
detailRoute: 'AccountChangeSecretExecutionDetail',
|
||||||
tableConfig: {
|
automationRoute: 'AccountChangeSecretDetail',
|
||||||
url: '/api/v1/accounts/change-secret-executions/',
|
resource: 'changesecretexecution'
|
||||||
columns: [
|
|
||||||
'automation', 'change_secret_name', 'asset_amount', 'node_amount', 'status',
|
|
||||||
'trigger', 'date_start', 'date_finished', 'actions'
|
|
||||||
],
|
|
||||||
columnsShow: {
|
|
||||||
default: [
|
|
||||||
'automation', 'change_secret_name', 'trigger', 'status',
|
|
||||||
'date_start', 'date_finished', 'actions'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
columnsMeta: {
|
|
||||||
automation: {
|
|
||||||
label: this.$t('ID'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
route: 'AccountChangeSecretExecutionDetail',
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'AccountChangeSecretExecutionDetail',
|
|
||||||
params: { id: row.id }
|
|
||||||
}),
|
|
||||||
getDrawerTitle: ({ row }) => row.id,
|
|
||||||
getTitle: ({ row }) => row.id.slice(0, 8),
|
|
||||||
drawer: true,
|
|
||||||
can: this.$hasPerm('accounts.view_changesecretexecution')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
change_secret_name: {
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
drawer: true,
|
|
||||||
getDrawerTitle({ row }) {
|
|
||||||
return row.automation.name
|
|
||||||
},
|
|
||||||
getTitle: ({ row }) => row.automation.name,
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'AccountChangeSecretDetail',
|
|
||||||
params: { id: row.automation.id }
|
|
||||||
})
|
|
||||||
},
|
|
||||||
id: ({ row }) => row.automation
|
|
||||||
},
|
|
||||||
asset_amount: {
|
|
||||||
label: this.$t('AssetsOfNumber'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return <span>{row.snapshot.asset_amount}</span>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
node_amount: {
|
|
||||||
label: this.$t('NodeOfNumber'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return <span>{row.snapshot.node_amount}</span>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
label: this.$t('Result')
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
formatterArgs: {
|
|
||||||
hasDelete: false,
|
|
||||||
hasUpdate: false,
|
|
||||||
hasClone: false,
|
|
||||||
extraActions: [
|
|
||||||
{
|
|
||||||
name: 'log',
|
|
||||||
type: 'primary',
|
|
||||||
can: this.$hasPerm('accounts.view_changesecretexecution'),
|
|
||||||
title: this.$t('Log'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
openTaskPage(row['id'])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'report',
|
|
||||||
title: this.$t('Report'),
|
|
||||||
type: 'success',
|
|
||||||
can: this.$hasPerm('accounts.view_changesecretexecution'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
vm.visible = true
|
|
||||||
vm.reportUrl = `/api/v1/accounts/change-secret-executions/${row.id}/report/`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'record',
|
|
||||||
title: this.$t('Record'),
|
|
||||||
can: this.$hasPerm('accounts.view_changesecretrecord'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
return this.$router.push({
|
|
||||||
name: 'AccountChangeSecretList',
|
|
||||||
query: {
|
|
||||||
tab: 'ChangeSecretRecord',
|
|
||||||
execution_id: row.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headerActions: {
|
|
||||||
searchConfig: {
|
|
||||||
getUrlQuery: true,
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: this.$t('TaskID'),
|
|
||||||
value: 'automation_id'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
value: 'automation__name'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
hasLeftActions: false,
|
|
||||||
hasMoreActions: false,
|
|
||||||
hasExport: false,
|
|
||||||
hasImport: false,
|
|
||||||
hasCreate: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
const automation_id = this.$route.query.automation_id
|
|
||||||
if (automation_id !== undefined) {
|
|
||||||
this.tableConfig.url = `${this.tableConfig.url}?automation_id=${automation_id}`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
<template>
|
||||||
|
<BaseExecutionList
|
||||||
|
:automation-route="automationRoute"
|
||||||
|
:detail-route="detailRoute"
|
||||||
|
:resource="resource"
|
||||||
|
:url="url"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BaseExecutionList from '@/views/accounts/Automation/BaseExecutionList.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'AccountDiscoverTaskExecutionList',
|
||||||
|
components: {
|
||||||
|
BaseExecutionList
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
object: {
|
||||||
|
type: Object,
|
||||||
|
required: false,
|
||||||
|
default: () => ({})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
url: '/api/v1/accounts/gather-account-executions/',
|
||||||
|
detailRoute: 'AccountDiscoverExecutionDetail',
|
||||||
|
automationRoute: 'AccountDiscoverTaskDetail',
|
||||||
|
resource: 'gatheraccountsexecution'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
@ -21,7 +21,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
const vm = this
|
const vm = this
|
||||||
return {
|
return {
|
||||||
createDrawer: () => import('@/views/accounts/AccountDiscover/TaskCreateUpdate.vue'),
|
createDrawer: () => import('@/views/accounts/AccountDiscover/AccountDiscoverTaskCreateUpdate.vue'),
|
||||||
detailDrawer: () => import('@/views/accounts/AccountDiscover/TaskDetail/index.vue'),
|
detailDrawer: () => import('@/views/accounts/AccountDiscover/TaskDetail/index.vue'),
|
||||||
showViewSecretDialog: false,
|
showViewSecretDialog: false,
|
||||||
showTableUpdateDrawer: false,
|
showTableUpdateDrawer: false,
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { GenericDetailPage, TabPage } from '@/layout/components'
|
import { GenericDetailPage, TabPage } from '@/layout/components'
|
||||||
import Detail from './Detail.vue'
|
import Detail from './Detail.vue'
|
||||||
import TaskExecutionList from '../TaskExecutionList.vue'
|
import TaskExecutionList from '../AccountDiscoverExecutionList.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountDiscoverTaskDetail',
|
name: 'AccountDiscoverTaskDetail',
|
||||||
|
@ -35,7 +35,7 @@ export default {
|
|||||||
title: this.$t('ExecutionHistory'),
|
title: this.$t('ExecutionHistory'),
|
||||||
name: 'AccountDiscoverTaskExecutionList',
|
name: 'AccountDiscoverTaskExecutionList',
|
||||||
hidden: !this.$hasPerm('accounts.view_gatheraccountsexecution'),
|
hidden: !this.$hasPerm('accounts.view_gatheraccountsexecution'),
|
||||||
component: () => import('@/views/accounts/AccountDiscover/TaskExecutionList.vue')
|
component: () => import('@/views/accounts/AccountDiscover/AccountDiscoverExecutionList.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,163 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<BaseExecutionList
|
||||||
<GenericListTable
|
:automation-route="automationRoute"
|
||||||
ref="listTable"
|
:detail-drawer="detailDrawer"
|
||||||
:detail-drawer="detailDrawer"
|
:detail-route="detailRoute"
|
||||||
:header-actions="headerActions"
|
:resource="resource"
|
||||||
:table-config="tableConfig"
|
:resource-label="resourceLabel"
|
||||||
/>
|
:url="url"
|
||||||
<ReportDialog :url="reportUrl" :visible.sync="visible" />
|
/>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
import BaseExecutionList from '@/views/accounts/Automation/BaseExecutionList.vue'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
|
||||||
import ReportDialog from '@/components/Dialog/ReportDialog'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AccountPushExecutionList',
|
name: 'AccountPushExecutionList',
|
||||||
components: {
|
components: {
|
||||||
GenericListTable,
|
BaseExecutionList
|
||||||
ReportDialog
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const vm = this
|
|
||||||
return {
|
return {
|
||||||
visible: false,
|
url: '/api/v1/accounts/push-account-executions/',
|
||||||
reportUrl: '',
|
automationRoute: 'AccountPushDetail',
|
||||||
detailDrawer: () => import('@/views/accounts/AccountPush/ExecutionDetail/index.vue'),
|
detailRoute: 'AccountPushExecutionDetail',
|
||||||
tableConfig: {
|
resource: 'pushaccountexecution',
|
||||||
url: '/api/v1/accounts/push-account-executions/',
|
resourceLabel: this.$t('AccountPushExecution'),
|
||||||
columns: [
|
detailDrawer: () => import('@/views/accounts/AccountPush/ExecutionDetail/index.vue')
|
||||||
'automation', 'push_user_name', 'asset_amount', 'node_amount', 'status',
|
|
||||||
'trigger', 'date_start', 'date_finished', 'actions'
|
|
||||||
],
|
|
||||||
columnsShow: {
|
|
||||||
default: [
|
|
||||||
'automation', 'push_user_name', 'trigger', 'status',
|
|
||||||
'date_start', 'date_finished', 'actions'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
columnsMeta: {
|
|
||||||
automation: {
|
|
||||||
label: this.$t('ID'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
route: 'AccountPushExecutionDetail',
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'AccountPushExecutionDetail',
|
|
||||||
params: { id: row.id }
|
|
||||||
}),
|
|
||||||
getDrawerTitle: ({ row }) => row.id,
|
|
||||||
getTitle: ({ row }) => row.id.slice(0, 8),
|
|
||||||
drawer: true,
|
|
||||||
can: this.$hasPerm('accounts.view_pushaccountexecution')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
push_user_name: {
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
drawer: true,
|
|
||||||
getTitle: ({ row }) => row.automation?.name,
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'AccountPushDetail',
|
|
||||||
params: { id: row.automation.id }
|
|
||||||
}),
|
|
||||||
getDrawerTitle({ row }) {
|
|
||||||
return row.automation?.name
|
|
||||||
}
|
|
||||||
},
|
|
||||||
id: ({ row }) => row.automation
|
|
||||||
},
|
|
||||||
asset_amount: {
|
|
||||||
label: this.$t('AssetsOfNumber'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return <span>{row.snapshot.asset_amount}</span>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
node_amount: {
|
|
||||||
label: this.$t('NodeOfNumber'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return <span>{row.snapshot.node_amount}</span>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
label: this.$t('Result')
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
formatterArgs: {
|
|
||||||
hasDelete: false,
|
|
||||||
hasUpdate: false,
|
|
||||||
hasClone: false,
|
|
||||||
extraActions: [
|
|
||||||
{
|
|
||||||
name: 'log',
|
|
||||||
type: 'primary',
|
|
||||||
can: this.$hasPerm('accounts.view_pushaccountexecution'),
|
|
||||||
title: this.$t('Log'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
openTaskPage(row['id'])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'report',
|
|
||||||
title: this.$t('Report'),
|
|
||||||
can: this.$hasPerm('accounts.view_pushaccountexecution'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
vm.visible = true
|
|
||||||
vm.reportUrl = `/api/v1/accounts/push-account-executions/${row.id}/report/`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'record',
|
|
||||||
title: this.$t('Record'),
|
|
||||||
can: this.$hasPerm('accounts.view_pushsecretrecord'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
return this.$router.push({
|
|
||||||
name: 'AccountPushList',
|
|
||||||
query: {
|
|
||||||
tab: 'AccountPushRecord',
|
|
||||||
execution_id: row.id
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headerActions: {
|
|
||||||
searchConfig: {
|
|
||||||
getUrlQuery: true,
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: this.$t('TaskID'),
|
|
||||||
value: 'automation_id'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
value: 'automation__name'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
hasSearch: true,
|
|
||||||
hasRefresh: true,
|
|
||||||
hasRightActions: true,
|
|
||||||
hasLeftActions: false,
|
|
||||||
hasMoreActions: false,
|
|
||||||
hasExport: false,
|
|
||||||
hasImport: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
const automation_id = this.$route.query.automation_id
|
|
||||||
if (automation_id !== undefined) {
|
|
||||||
this.tableConfig.url = `${this.tableConfig.url}?automation_id=${automation_id}`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
<GenericListTable
|
||||||
<ReportDialog :visible.sync="visible" :url="reportUrl" />
|
:header-actions="headerActions"
|
||||||
|
:table-config="tableConfig"
|
||||||
|
/>
|
||||||
|
<ReportDialog :url="reportUrl" :visible.sync="visible" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,10 +24,21 @@ export default {
|
|||||||
GenericListTable
|
GenericListTable
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
object: {
|
url: {
|
||||||
type: Object,
|
type: String,
|
||||||
required: false,
|
required: true
|
||||||
default: () => ({})
|
},
|
||||||
|
detailRoute: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
automationRoute: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
resource: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -36,7 +50,7 @@ export default {
|
|||||||
currentTemplate: null,
|
currentTemplate: null,
|
||||||
drawerTitle: '',
|
drawerTitle: '',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/accounts/gather-account-executions/',
|
url: this.url,
|
||||||
columns: [
|
columns: [
|
||||||
'id', 'automation', 'status', 'trigger',
|
'id', 'automation', 'status', 'trigger',
|
||||||
'date_start', 'date_finished', 'actions'
|
'date_start', 'date_finished', 'actions'
|
||||||
@ -45,10 +59,11 @@ export default {
|
|||||||
id: {
|
id: {
|
||||||
label: this.$t('ID'),
|
label: this.$t('ID'),
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
|
width: '100px',
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
route: 'AccountDiscoverExecutionDetail',
|
route: this.detailRoute,
|
||||||
getRoute: ({ row }) => ({
|
getRoute: ({ row }) => ({
|
||||||
name: 'AccountDiscoverExecutionDetail',
|
name: this.detailRoute,
|
||||||
params: { id: row.id }
|
params: { id: row.id }
|
||||||
}),
|
}),
|
||||||
getTitle: ({ row }) => row.id.slice(0, 8),
|
getTitle: ({ row }) => row.id.slice(0, 8),
|
||||||
@ -64,19 +79,20 @@ export default {
|
|||||||
width: '135px'
|
width: '135px'
|
||||||
},
|
},
|
||||||
automation: {
|
automation: {
|
||||||
label: this.$t('Name'),
|
label: this.$t('Task'),
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
|
minWidth: '180px',
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
getTitle: ({ row }) => row.automation.name,
|
getTitle: ({ row }) => row.snapshot.name,
|
||||||
getRoute: ({ row }) => ({
|
getRoute: ({ row }) => ({
|
||||||
name: 'AccountDiscoverTaskDetail',
|
name: this.automationRoute,
|
||||||
params: { id: row.automation.id }
|
params: { id: row.automation.id }
|
||||||
}),
|
}),
|
||||||
getDrawerTitle: ({ row }) => row.automation.name,
|
can: ({ row }) => row.automation?.id,
|
||||||
drawer: true
|
drawer: true
|
||||||
},
|
},
|
||||||
id: ({ row }) => row.automation,
|
id: ({ row }) => row.automation,
|
||||||
can: this.$hasPerm('accounts.view_gatheraccountsexecution')
|
can: this.$hasPerm('accounts.view_' + this.resource)
|
||||||
},
|
},
|
||||||
date_start: {
|
date_start: {
|
||||||
width: null
|
width: null
|
||||||
@ -99,10 +115,10 @@ export default {
|
|||||||
name: 'report',
|
name: 'report',
|
||||||
title: this.$t('Report'),
|
title: this.$t('Report'),
|
||||||
type: 'success',
|
type: 'success',
|
||||||
can: this.$hasPerm('accounts.view_gatheraccountsexecution'),
|
can: this.$hasPerm('accounts.view_' + this.resource),
|
||||||
callback: function({ row }) {
|
callback: function({ row }) {
|
||||||
vm.visible = true
|
vm.visible = true
|
||||||
vm.reportUrl = `/api/v1/accounts/gather-account-executions/${row.id}/report/`
|
vm.reportUrl = `${this.url}${row.id}/report/`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -141,10 +157,6 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
handleDetailCallback(row) {
|
handleDetailCallback(row) {
|
||||||
this.$route.params.id = row.id
|
this.$route.params.id = row.id
|
||||||
|
|
||||||
this.$route.query.type = 'pam'
|
|
||||||
|
|
||||||
this.currentTemplate = 'AccountDiscoverExecutionDetail'
|
|
||||||
this.showTableUpdateDrawer = true
|
this.showTableUpdateDrawer = true
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,21 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<BaseExecutionList
|
||||||
<GenericListTable ref="listTable" :header-actions="headerActions" :table-config="tableConfig" />
|
:automation-route="automationRoute"
|
||||||
<ReportDialog :url="reportUrl" :visible.sync="visible" />
|
:detail-route="detailRoute"
|
||||||
</div>
|
:resource="resource"
|
||||||
|
:url="url"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
|
import BaseExecutionList from '@/views/accounts/Automation/BaseExecutionList.vue'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
|
||||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
|
||||||
import ReportDialog from '@/components/Dialog/ReportDialog.vue'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CheckAccountExecutionList',
|
name: 'CheckAccountExecutionList',
|
||||||
components: {
|
components: {
|
||||||
ReportDialog,
|
BaseExecutionList
|
||||||
GenericListTable
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
object: {
|
object: {
|
||||||
@ -25,124 +23,11 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const vm = this
|
|
||||||
return {
|
return {
|
||||||
visible: false,
|
url: '/api/v1/accounts/check-account-executions/',
|
||||||
reportUrl: '',
|
automationRoute: 'AccountCheckDetail',
|
||||||
tableConfig: {
|
detailRoute: 'RiskHistoryExecutionDetail',
|
||||||
url: '/api/v1/accounts/check-account-executions/',
|
resource: 'checkaccountexecution'
|
||||||
columns: [
|
|
||||||
'automation', 'task_name', 'asset_amount',
|
|
||||||
'node_amount', 'status', 'trigger',
|
|
||||||
'date_start', 'date_finished', 'actions'
|
|
||||||
],
|
|
||||||
columnsShow: {
|
|
||||||
default: [
|
|
||||||
'automation', 'task_name', 'status',
|
|
||||||
'date_start', 'date_finished', 'actions'
|
|
||||||
]
|
|
||||||
},
|
|
||||||
columnsMeta: {
|
|
||||||
automation: {
|
|
||||||
label: this.$t('ID'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'RiskHistoryExecutionDetail',
|
|
||||||
params: { id: row.id }
|
|
||||||
}),
|
|
||||||
getTitle: ({ row }) => row.id.slice(0, 8),
|
|
||||||
getDrawerTitle: ({ row }) => row.id,
|
|
||||||
drawer: true,
|
|
||||||
can: this.$hasPerm('accounts.view_checkaccountexecution')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
task_name: {
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
formatter: DetailFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
drawer: true,
|
|
||||||
getTitle: ({ row }) => row.automation.name,
|
|
||||||
getRoute: ({ row }) => ({
|
|
||||||
name: 'AccountCheckDetail',
|
|
||||||
params: { id: row.automation.id }
|
|
||||||
}),
|
|
||||||
getDrawerTitle: ({ row }) => row.automation.name
|
|
||||||
},
|
|
||||||
id: ({ row }) => row.automation
|
|
||||||
},
|
|
||||||
asset_amount: {
|
|
||||||
label: this.$t('AssetsOfNumber'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return <span>{row.snapshot.asset_amount}</span>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
node_amount: {
|
|
||||||
label: this.$t('NodeOfNumber'),
|
|
||||||
formatter: function(row) {
|
|
||||||
return <span>{row.snapshot.node_amount}</span>
|
|
||||||
}
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
label: this.$t('Result')
|
|
||||||
},
|
|
||||||
actions: {
|
|
||||||
formatterArgs: {
|
|
||||||
hasDelete: false,
|
|
||||||
hasUpdate: false,
|
|
||||||
hasClone: false,
|
|
||||||
extraActions: [
|
|
||||||
{
|
|
||||||
name: 'log',
|
|
||||||
type: 'primary',
|
|
||||||
can: this.$hasPerm('accounts.view_checkaccountexecution'),
|
|
||||||
title: this.$t('Log'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
openTaskPage(row['id'])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'report',
|
|
||||||
title: this.$t('Report'),
|
|
||||||
type: 'success',
|
|
||||||
can: this.$hasPerm('accounts.view_checkaccountexecution'),
|
|
||||||
callback: function({ row }) {
|
|
||||||
vm.visible = true
|
|
||||||
vm.reportUrl = `/api/v1/accounts/check-account-executions/${row.id}/report/`
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headerActions: {
|
|
||||||
searchConfig: {
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
label: this.$t('TaskID'),
|
|
||||||
value: 'automation_id'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: this.$t('DisplayName'),
|
|
||||||
value: 'automation__name'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
hasSearch: true,
|
|
||||||
hasRefresh: true,
|
|
||||||
hasRightActions: true,
|
|
||||||
hasLeftActions: false,
|
|
||||||
hasMoreActions: false,
|
|
||||||
hasExport: false,
|
|
||||||
hasImport: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
const automation_id = this.$route.query.automation_id
|
|
||||||
if (automation_id !== undefined) {
|
|
||||||
this.tableConfig.url = `${this.tableConfig.url}?automation_id=${automation_id}`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,9 @@ function updatePlatformProtocols(vm, platformType, updateForm, isPlatformChanged
|
|||||||
'username_selector': setting.username_selector
|
'username_selector': setting.username_selector
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 这里不能清空,比如 gateway 切换时,protocol 没有变化,就会出现 bug, tapd: 1053282
|
||||||
|
// updateForm({ protocols: [] })
|
||||||
vm.iConfig.fieldsMeta.protocols.el.choices = platformProtocols
|
vm.iConfig.fieldsMeta.protocols.el.choices = platformProtocols
|
||||||
updateForm({ protocols: [] })
|
|
||||||
}), 100)
|
}), 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user