Show run setup errors

This commit is contained in:
Simone Gotti 2019-04-10 11:21:18 +02:00
parent c8effcc334
commit b4cd9806b0
4 changed files with 69 additions and 25 deletions

View File

@ -1,37 +1,53 @@
<template> <template>
<div> <div>
<RunDetail :run="run"/> <RunDetail :run="run"/>
<div v-if="run.phase != 'setuperror'">
<div class="tabs">
<ul>
<li>
<a>Tasks</a>
</li>
</ul>
</div>
<div class="tabs"> <div v-if="run" class="tasks-list">
<ul> <div v-for="task in run.sortedTasks" v-bind:key="task.id" :class="taskClass(task)">
<li> <div class="task-content">
<a>Tasks</a> <div class="columns">
</li> <router-link class="column is-10" tag="a" :to="runTaskLink(task)">
</ul> <span class="name">{{task.name}}</span>
</div> </router-link>
<div class="column">
<div v-if="run" class="tasks-list"> <span
<div v-for="task in run.sortedTasks" v-bind:key="task.id" :class="taskClass(task)"> class="tag"
<div class="task-content"> v-if="run.tasks_waiting_approval.includes(task.id)"
<div class="columns"> >Waiting approval</span>
<router-link class="column is-10" tag="a" :to="runTaskLink(task)"> </div>
<span class="name">{{task.name}}</span> <div class="parents column">
</router-link> <span v-if="parents(task).length > 0">depends on: &nbsp;</span>
<div class="column"> <span class="parent" v-for="dep in parents(task)" v-bind:key="dep">{{dep}}</span>
<span class="tag" v-if="run.tasks_waiting_approval.includes(task.id)">Waiting approval</span> </div>
</div> </div>
<div class="parents column"> <!-- <span
<span v-if="parents(task).length > 0">depends on: &nbsp;</span>
<span class="parent" v-for="dep in parents(task)" v-bind:key="dep">{{dep}}</span>
</div>
</div>
<!-- <span
class="duration" class="duration"
v-if="duration && (step.Phase == 'success' || step.Phase == 'failed') " v-if="duration && (step.Phase == 'success' || step.Phase == 'failed') "
>{{duration}}</span>--> >{{duration}}</span>-->
</div>
</div> </div>
</div> </div>
</div> </div>
<div v-else>
<div class="tabs">
<ul>
<li>
<a>Setup Errors</a>
</li>
</ul>
</div>
<div class="setuperrors">
<span class="error-line" v-for="(error, i) in run.setup_errors" v-bind:key="i">{{error}}</span>
</div>
</div>
</div> </div>
</template> </template>
@ -156,4 +172,23 @@ export default {
} }
} }
} }
.setuperrors {
background-color: #222;
color: #f1f1f1;
font-family: Cousine, monospace;
font-size: 12px;
line-height: 19px;
white-space: pre-wrap;
word-wrap: break-word;
text-align: left;
font-size: 12px;
padding: 5px;
.error-line {
pre {
line-height: 1.2;
}
}
}
</style> </style>

View File

@ -117,6 +117,7 @@ export default {
runResultClass(run) { runResultClass(run) {
let status = this.runStatus(run); let status = this.runStatus(run);
if (status == "setuperror") return "setuperror";
if (status == "queued") return "unknown"; if (status == "queued") return "unknown";
if (status == "cancelled") return "failed"; if (status == "cancelled") return "failed";
if (status == "running") return "running"; if (status == "running") return "running";
@ -206,6 +207,10 @@ export default {
border-left: 5px solid $grey-lighter; border-left: 5px solid $grey-lighter;
} }
.setuperror {
border-left: 5px solid $yellow;
}
.name { .name {
font-weight: bold; font-weight: bold;
cursor: pointer; cursor: pointer;

View File

@ -102,6 +102,7 @@ export default {
}, },
runResultClass(run) { runResultClass(run) {
if (run.result == "unknown") { if (run.result == "unknown") {
if (run.phase == "setuperror") return "setuperror";
if (run.phase == "queued") return "unknown"; if (run.phase == "queued") return "unknown";
if (run.phase == "cancelled") return "failed"; if (run.phase == "cancelled") return "failed";
if (run.phase == "running") return "running"; if (run.phase == "running") return "running";
@ -218,6 +219,10 @@ export default {
border-left: 5px solid $grey-lighter; border-left: 5px solid $grey-lighter;
} }
.setuperror {
border-left: 5px solid $yellow;
}
.name { .name {
flex: 0 0 30%; flex: 0 0 30%;
font-weight: bold; font-weight: bold;

View File

@ -13,7 +13,6 @@ $purple: #8e44ad;
$red: #e42522; $red: #e42522;
$white-ter: #ecf0f1; $white-ter: #ecf0f1;
$primary: #34495e !default; $primary: #34495e !default;
$yellow-invert: #fff;
$grey-lighter-invert: findColorInvert($grey-lighter); $grey-lighter-invert: findColorInvert($grey-lighter);
$green-invert: findColorInvert($green); $green-invert: findColorInvert($green);