Files
FabledSteward/steward/templates/ansible/index.html
T
bvandeusenandClaude Opus 5.5 c2a79c8bb0
CI / lint (push) Successful in 3s
CI / integration (push) Successful in 46s
CI / unit (push) Successful in 1m7s
CI / publish (push) Successful in 59s
feat(ansible): runs named by what ran where, with ago, duration and one status badge (#5125)
Runs read "update.yml on web-1" (run_title over the scope label, beside
describe_scope) on the runs list, the run page's title and breadcrumb, and
the run-started panel. The list shows started |ago (full time on hover),
|duration (counting "so far" while a run is going) and a dry-run tag.

Run statuses join STATES, so the list and the run page use status_badge:
queued dim, running info (blue, so work in progress doesn't read as a
problem), success ok "Succeeded", failed crit, interrupted warn, cancelled
dim. run_started.html leaves its hard-coded colours for tokens; the run
page's facts move to the .kv list and its failures to var(--red). Template
hex colours: 54 -> 47.

Also fixes #5124's sidebar count, which CI run 8389 failed on: the stylesheet
guard allows no weight above 500, and .nav-count asked for 600.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 18:16:07 -04:00

42 lines
1.6 KiB
HTML

{% extends "base.html" %}
{% from "_macros.html" import page_header, status_badge, empty_state %}
{% block title %}Ansible Runs — Steward{% endblock %}
{% block content %}
{% call page_header("Ansible Runs", "Each run by what it ran where, newest first.") %}
<a href="/ansible/inventory/targets" class="btn btn-ghost">Inventory</a>
<a href="/ansible/schedules" class="btn btn-ghost">Schedules</a>
<a href="/ansible/browse" class="btn">Browse Playbooks</a>
{% endcall %}
{% if not runs %}
<div class="card">{{ empty_state("No runs yet.", "Browse playbooks", "/ansible/browse") }}</div>
{% else %}
<div class="card-flush">
<table class="table">
<thead>
<tr>
<th>Run</th>
<th>Status</th>
<th>Started</th>
<th>Duration</th>
</tr>
</thead>
<tbody>
{% for row in runs %}
{% set run = row.run %}
<tr>
<td>
<a href="/ansible/runs/{{ run.id }}" title="{{ run.inventory_scope }}">{{ row.title }}</a>
{% if row.check %}<span class="badge badge-dim" title="Ansible check mode: nothing was changed">dry run</span>{% endif %}
<div class="field-hint">{{ run.source_name }}</div>
</td>
<td>{{ status_badge(run.status) }}</td>
<td title="{{ run.started_at.strftime('%Y-%m-%d %H:%M:%S UTC') }}">{{ run.started_at|ago }}</td>
<td>{{ row.duration_s|duration }}{% if not run.finished_at and run.status.value in ('running', 'queued') %} so far{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% endblock %}