From 71e27fe8a094417e2faa7164417e8d312630ae90 Mon Sep 17 00:00:00 2001 From: xinwen Date: Fri, 12 Jun 2020 10:54:13 +0800 Subject: [PATCH] =?UTF-8?q?[Fix]=20=E4=BD=9C=E4=B8=9A=E4=B8=AD=E5=BF=83/?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=AF=A6=E6=83=85/=20=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=88=90=E5=8A=9F/=E5=A4=B1=E8=B4=A5=20?= =?UTF-8?q?=E4=B8=BB=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ops/TaskDetail/TaskDetail.vue | 39 +++++++++++++++---------- 1 file changed, 23 insertions(+), 16 deletions(-) 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: {} } },