Merge branch 'dev' of github.com:jumpserver/lina into dev

This commit is contained in:
Bai
2020-06-12 10:55:40 +08:00

View File

@@ -4,8 +4,8 @@
<DetailCard :title="cardTitle" :items="detailCardItems" /> <DetailCard :title="cardTitle" :items="detailCardItems" />
</el-col> </el-col>
<el-col :span="10"> <el-col :span="10">
<RunInfoCard type="info" v-bind="RunSuccessConfig" /> <RunInfoCard v-for="config in RunSuccessConfigs" :key="config.host" type="info" v-bind="config" />
<RunInfoCard type="danger" style="margin-top: 15px" v-bind="RunFailedConfig" /> <RunInfoCard v-for="config in RunFailedConfigs" :key="config.host" type="danger" style="margin-top: 15px" v-bind="config" />
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
@@ -27,23 +27,30 @@ export default {
} }
}, },
data() { data() {
this.object.last_success.length || (this.object.last_success = [''])
this.object.last_failure.length || (this.object.last_failure = [['', '']])
return {
RunSuccessConfigs: this.object.last_success.map(val => {
return { return {
RunSuccessConfig: {
icon: 'fa-info', icon: 'fa-info',
title: this.$t('ops.lastRunSuccessHosts'), title: this.$t('ops.lastRunSuccessHosts'),
content: { content: {
hostname: this.object.last_success[0], hostname: val,
result: this.object.last_success[1] result: ''
} }
}, }
RunFailedConfig: { }),
RunFailedConfigs: this.object.last_failure.map(([host, msg]) => {
return {
icon: 'fa-info', icon: 'fa-info',
title: this.$t('ops.lastRunFailedHosts'), title: this.$t('ops.lastRunFailedHosts'),
content: { content: {
hostname: this.object.last_failure[0], hostname: host,
result: this.object.last_failure[1] result: msg
} }
}, }
}),
taskData: {} taskData: {}
} }
}, },