diff --git a/src/views/ops/TaskDetail/TaskDetail.vue b/src/views/ops/TaskDetail/TaskDetail.vue index 4e1c5c8ed..e569a23a0 100644 --- a/src/views/ops/TaskDetail/TaskDetail.vue +++ b/src/views/ops/TaskDetail/TaskDetail.vue @@ -4,8 +4,8 @@ - - + + @@ -27,23 +27,30 @@ export default { } }, data() { + this.object.last_success.length || (this.object.last_success = ['']) + this.object.last_failure.length || (this.object.last_failure = [['', '']]) + return { - RunSuccessConfig: { - icon: 'fa-info', - title: this.$t('ops.lastRunSuccessHosts'), - content: { - hostname: this.object.last_success[0], - result: this.object.last_success[1] + RunSuccessConfigs: this.object.last_success.map(val => { + return { + icon: 'fa-info', + title: this.$t('ops.lastRunSuccessHosts'), + content: { + hostname: val, + result: '' + } } - }, - RunFailedConfig: { - icon: 'fa-info', - title: this.$t('ops.lastRunFailedHosts'), - content: { - hostname: this.object.last_failure[0], - result: this.object.last_failure[1] + }), + RunFailedConfigs: this.object.last_failure.map(([host, msg]) => { + return { + icon: 'fa-info', + title: this.$t('ops.lastRunFailedHosts'), + content: { + hostname: host, + result: msg + } } - }, + }), taskData: {} } },