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 { return {
RunSuccessConfig: { RunSuccessConfigs: this.object.last_success.map(val => {
icon: 'fa-info', return {
title: this.$t('ops.lastRunSuccessHosts'), icon: 'fa-info',
content: { title: this.$t('ops.lastRunSuccessHosts'),
hostname: this.object.last_success[0], content: {
result: this.object.last_success[1] hostname: val,
result: ''
}
} }
}, }),
RunFailedConfig: { RunFailedConfigs: this.object.last_failure.map(([host, msg]) => {
icon: 'fa-info', return {
title: this.$t('ops.lastRunFailedHosts'), icon: 'fa-info',
content: { title: this.$t('ops.lastRunFailedHosts'),
hostname: this.object.last_failure[0], content: {
result: this.object.last_failure[1] hostname: host,
result: msg
}
} }
}, }),
taskData: {} taskData: {}
} }
}, },