mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-17 23:59:02 +00:00
Merge pull request #2157 from jumpserver/pr@v3@gather_account
perf: gather account page
This commit is contained in:
@@ -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: {
|
||||
|
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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 => {
|
||||
|
Reference in New Issue
Block a user