diff --git a/src/views/accounts/GatheredUser/TaskCreateUpdate.vue b/src/views/accounts/GatheredUser/TaskCreateUpdate.vue index a11207bbd..d45b4e5fc 100644 --- a/src/views/accounts/GatheredUser/TaskCreateUpdate.vue +++ b/src/views/accounts/GatheredUser/TaskCreateUpdate.vue @@ -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: { diff --git a/src/views/accounts/GatheredUser/TaskDetail/TaskExecutionList.vue b/src/views/accounts/GatheredUser/TaskDetail/TaskExecutionList.vue index 1c9195421..ccd9bccc6 100644 --- a/src/views/accounts/GatheredUser/TaskDetail/TaskExecutionList.vue +++ b/src/views/accounts/GatheredUser/TaskDetail/TaskExecutionList.vue @@ -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') } } diff --git a/src/views/accounts/GatheredUser/TaskDetail/index.vue b/src/views/accounts/GatheredUser/TaskDetail/index.vue index 7bcbeb2ea..71a5ba970 100644 --- a/src/views/accounts/GatheredUser/TaskDetail/index.vue +++ b/src/views/accounts/GatheredUser/TaskDetail/index.vue @@ -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 diff --git a/src/views/accounts/GatheredUser/TaskList.vue b/src/views/accounts/GatheredUser/TaskList.vue index 365e483a1..1c00b6bef 100644 --- a/src/views/accounts/GatheredUser/TaskList.vue +++ b/src/views/accounts/GatheredUser/TaskList.vue @@ -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 => {