Merge pull request #2157 from jumpserver/pr@v3@gather_account

perf: gather account page
This commit is contained in:
feng626
2022-11-09 16:02:01 +08:00
committed by GitHub
4 changed files with 21 additions and 21 deletions

View File

@@ -17,7 +17,7 @@ export default {
[this.$t('xpack.Timer'), ['is_periodic', 'crontab', 'interval']],
[this.$t('common.Other'), ['comment']]
],
url: '/api/v1/xpack/gathered-user/tasks/',
url: '/api/v1/assets/gather-account-automations/',
hasDetailInMsg: false,
fieldsMeta: {
crontab: {

View File

@@ -24,8 +24,8 @@ export default {
hasSearch: false
},
tableConfig: {
url: `/api/v1/xpack/gathered-user/task-executions/?task=${this.object.id}`,
columns: ['timedelta', 'date_start', 'success'],
url: `/api/v1/assets/automation-executions/?automation_id=${this.object.id}`,
columns: ['trigger_display', 'date_start', 'date_finished', 'status'],
columnsMeta: {
timedelta: {
label: this.$t('ops.timeDelta'),
@@ -36,10 +36,6 @@ export default {
},
date_start: {
width: null
},
success: {
width: null,
label: this.$t('common.Success')
}
}

View File

@@ -22,10 +22,11 @@ export default {
return {
TaskDetail: {},
config: {
url: '/api/v1/assets/gather-account-automations/',
activeMenu: 'Detail',
actions: {
canUpdate: this.$hasPerm('xpack.change_gatherusertask'),
canDelete: this.$hasPerm('xpack.delete_gatherusertask')
canUpdate: this.$hasPerm('assets.change_automationexecution'),
canDelete: this.$hasPerm('assets.delete_automationexecution')
},
submenu: [
{
@@ -35,7 +36,7 @@ export default {
{
title: this.$t('xpack.GatherUser.GatherUserTaskExecutionList'),
name: 'TaskExecutionList',
hidden: !this.$hasPerm('xpack.view_gatherusertaskexecution')
hidden: !this.$hasPerm('assets.view_automationexecution')
}
],
hasRightSide: true

View File

@@ -17,17 +17,17 @@ export default {
return {
tableConfig: {
name: 'TaskListTable',
url: '/api/v1/xpack/gathered-user/tasks/',
url: '/api/v1/assets/gather-account-automations/',
permissions: {
app: 'xpack',
resource: 'gatherusertask'
app: 'assets',
resource: 'gatheraccountsautomation'
},
columns: [
'name', 'nodes', 'is_periodic', 'periodic_display',
'executed_times', 'actions'
'executed_amount', 'actions'
],
columnsShow: {
min: ['name', 'nodes', 'is_periodic', 'periodic_display', 'executed_times', 'actions']
min: ['name', 'nodes', 'is_periodic', 'periodic_display', 'executed_amount', 'actions']
},
columnsMeta: {
name: {
@@ -41,7 +41,7 @@ export default {
},
nodes: {
formatter: function(row, column, cellValue, index) {
return cellValue.length
return cellValue.map(v => v['name']).join(', ')
}
},
is_periodic: {
@@ -56,11 +56,11 @@ export default {
showOverflowTooltip: true,
width: 150
},
executed_times: {
executed_amount: {
formatter: DetailFormatter,
formatterArgs: {
route: 'GatherUserTaskDetail',
can: vm.$hasPerm('xpack.view_gatherusertaskexecution'),
can: vm.$hasPerm('assets.view_automationexecution'),
routeQuery: {
activeTab: 'TaskExecutionList'
}
@@ -75,11 +75,14 @@ export default {
title: vm.$t('xpack.Execute'),
name: 'execute',
type: 'info',
can: vm.$hasPerm('xpack.add_gatherusertaskexecution'),
can: vm.$hasPerm('assets.add_automationexecution'),
callback: function(data) {
this.$axios.post(
`/api/v1/xpack/gathered-user/task-executions/`,
{ task: data.row.id }
`/api/v1/assets/automation-executions/`,
{
automation: data.row.id,
type: data.row.type
}
).then(res => {
openTaskPage(res['task'])
}).catch(res => {