feat: show last-run duration on the groups list

groups_index attaches last_duration_s from the latest group run; groups.html
renders it as a new right-aligned duration column (— when never run).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Paul Trowbridge 2026-07-22 15:12:17 -04:00
parent 3b3fe6f865
commit 9a11050d3b
2 changed files with 4 additions and 0 deletions

View File

@ -1333,9 +1333,11 @@ def groups_index(request: Request):
if recent: if recent:
g["last_run_at"] = recent[0]["started_at"] g["last_run_at"] = recent[0]["started_at"]
g["last_status"] = recent[0]["status"] g["last_status"] = recent[0]["status"]
g["last_duration_s"] = recent[0]["duration_s"]
else: else:
g["last_run_at"] = None g["last_run_at"] = None
g["last_status"] = None g["last_status"] = None
g["last_duration_s"] = None
return _templates.TemplateResponse( return _templates.TemplateResponse(
request, "groups.html", request, "groups.html",
_ctx(groups=groups), _ctx(groups=groups),

View File

@ -19,6 +19,7 @@
<th>name</th> <th>name</th>
<th>members</th> <th>members</th>
<th>last run</th> <th>last run</th>
<th style="width:7em;text-align:right">duration</th>
<th style="width:9em">status</th> <th style="width:9em">status</th>
<th></th> <th></th>
</tr> </tr>
@ -29,6 +30,7 @@
<td><a href="/groups/{{ g.id }}"><strong>{{ g.name }}</strong></a></td> <td><a href="/groups/{{ g.id }}"><strong>{{ g.name }}</strong></a></td>
<td class="mono">{{ g.member_count }}</td> <td class="mono">{{ g.member_count }}</td>
<td class="mono">{{ g.last_run_at | localtime }}</td> <td class="mono">{{ g.last_run_at | localtime }}</td>
<td class="mono" style="text-align:right">{{ g.last_duration_s | duration }}</td>
<td> <td>
{% if g.last_status %} {% if g.last_status %}
<span class="pill {{ g.last_status }}">{{ g.last_status }}</span> <span class="pill {{ g.last_status }}">{{ g.last_status }}</span>