feat: add task state status badge

This commit is contained in:
Matthieu Bessat 2024-07-28 12:08:54 +02:00
parent bdd50303ba
commit 71c2b9dc63
3 changed files with 27 additions and 3 deletions

View file

@ -12,3 +12,15 @@ table tbody tr td:first-child {
.logs-lines {
white-space: nowrap;
}
.task-status_running {
background-color: blue;
}
.task-status_success {
background-color: green;
}
.task-status_failed {
background-color: red;
}

View file

@ -1,6 +1,11 @@
{% extends "layouts/base.html" %}
{% block body %}
<h1>List of task runs for "{{ task.name }}"</h1>
{% if runs | length == 0 %}
<p class="notice">
No tasks runs to show
</p>
{% else %}
<table>
<thead>
<tr>
@ -20,7 +25,9 @@
{{ task_run.started_at }}
</td>
<td>
<mark class="task-status_{{ task_run.status | lower }}">
{{ task_run.status }}
</mark>
</td>
<td>
<a href="/tasks/{{ task_id }}/runs/{{ task_run.id }}">Details</a>
@ -29,4 +36,5 @@
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}

View file

@ -3,7 +3,11 @@
<h1>Task run details</h1>
<ul>
<li>Id: {{ run.id }}</li>
<li>State: {{ run.status }}</li>
<li>State:
<mark class="task-status_{{ run.status | lower }}">
{{ run.status }}
</mark>
</li>
<li>Submitted at: {{ run.submitted_at }}</li>
<li>Started at: {{ run.started_at }}</li>
<li>Ended at: {{ run.ended_at }}</li>