Skip to content

Commit d2e0a43

Browse files
committed
Small frontend changes
1 parent 2db0c66 commit d2e0a43

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

site/frontend/src/pages/status/page.vue

+22-10
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ async function loadStatus(loading: Ref<boolean>) {
2626
data.value = await withLoading(loading, () =>
2727
getJson<StatusResponse>(STATUS_DATA_URL)
2828
);
29-
console.log(data.value);
3029
}
3130
3231
function formatDuration(seconds: number): string {
@@ -108,7 +107,7 @@ interface TimelineEntry {
108107
end_estimated: boolean;
109108
duration: number | null;
110109
errors: BenchmarkError[];
111-
warning: boolean;
110+
warning: string | null;
112111
current: boolean;
113112
}
114113
@@ -154,7 +153,7 @@ const currentRun: Ref<CurrentRun | null> = computed(() => {
154153
return null;
155154
});
156155
const lastFinishedRun: Ref<FinishedRun | null> = computed(() => {
157-
const finished = data?.value.finished_runs;
156+
const finished = data.value?.finished_runs;
158157
if (finished.length === 0) return null;
159158
return finished[0];
160159
});
@@ -204,7 +203,7 @@ const timeline: Ref<TimelineEntry[]> = computed(() => {
204203
end_estimated: true,
205204
errors: [],
206205
duration: null,
207-
warning: false,
206+
warning: null,
208207
current: false,
209208
});
210209
queued_before -= 1;
@@ -220,7 +219,7 @@ const timeline: Ref<TimelineEntry[]> = computed(() => {
220219
end_estimated: true,
221220
errors: [],
222221
duration: null,
223-
warning: false,
222+
warning: null,
224223
current: true,
225224
});
226225
}
@@ -230,6 +229,10 @@ const timeline: Ref<TimelineEntry[]> = computed(() => {
230229
? run.artifact["Tag"]
231230
: run.artifact["Commit"].type;
232231
232+
let warning = null;
233+
if (kind !== "Try" && run.errors.length > 0) {
234+
warning = "Master commit with errors";
235+
}
233236
timeline.push({
234237
pr: run.pr,
235238
kind,
@@ -239,7 +242,7 @@ const timeline: Ref<TimelineEntry[]> = computed(() => {
239242
end_estimated: false,
240243
errors: run.errors,
241244
duration: run.duration,
242-
warning: kind !== "Try" && run.errors.length > 0,
245+
warning,
243246
current: false,
244247
});
245248
}
@@ -369,11 +372,17 @@ loadStatus(loading);
369372
<td colspan="7"><hr /></td>
370373
</tr>
371374
<tr :class="{active: item.sha === currentRun?.commit?.sha}">
372-
<td class="centered" v-html="pullRequestUrlAsHtml(item.pr)"></td>
375+
<td
376+
class="right-align"
377+
v-html="pullRequestUrlAsHtml(item.pr)"
378+
></td>
373379
<td class="centered">
374-
{{ item.kind }}<template v-if="item.warning">❗</template>
380+
{{ item.kind
381+
}}<span v-if="item.warning !== null" :title="item.warning"
382+
>❗</span
383+
>
375384
</td>
376-
<td class="centered" v-html="commitUrlAsHtml(item.sha)"></td>
385+
<td class="right-align" v-html="commitUrlAsHtml(item.sha)"></td>
377386
<td class="centered">{{ item.status }}</td>
378387
<td>
379388
{{ item.end_time.toLocaleString()
@@ -382,7 +391,7 @@ loadStatus(loading);
382391
<td v-if="item.duration !== null">
383392
{{ formatDuration(item.duration) }}
384393
</td>
385-
<td v-else class="centered">?</td>
394+
<td v-else class="centered">-</td>
386395
<td v-if="item.errors.length > 0">
387396
<button @click="toggleExpandedErrors(item.sha)">
388397
{{ hasExpandedErrors(item.sha) ? "Hide" : "Show" }}
@@ -438,6 +447,9 @@ loadStatus(loading);
438447
&.centered {
439448
text-align: center;
440449
}
450+
&.right-align {
451+
text-align: right;
452+
}
441453
}
442454
tr.active {
443455
font-weight: bold;

0 commit comments

Comments
 (0)