Files
FabledSteward/steward/templates/ansible/index.html
T
bvandeusenandClaude Opus 5.5 0c72892f58
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 59s
CI / unit (push) Failing after 1m22s
CI / publish (push) Skipped
feat(ansible): schedules read as sentences, each with its own page (#5332)
- The Schedules tab: a verdict line (failing first, paused, next due),
  each schedule as one line (what runs where, how often, when next, how it
  last went); the row opens its page; Run now and Pause stay in the row.
- /ansible/schedules/new and /ansible/schedules/<id>: the form on classes,
  dry run beside the button, the playbook's variables rendered with the
  page; at the foot Delete behind the confirm dialog. ?source=&playbook=
  start a new one on a playbook (Schedule it on the playbook's page).
- A run started by a schedule links to that schedule's page.
- The run page's id guard allows the Run again link's ?from=.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 23:51:15 -04:00

41 lines
2.6 KiB
HTML

{# ansible/index.html — the Runs tab (#5329): a verdict line (how the last
30 days went, failures first, what runs next), a filter bar, then every run
newest first as the reader scrolls (ansible/_runs_table.html). #}
{% extends "base.html" %}
{% from "_macros.html" import page_header %}
{% from "ansible/_tabs.html" import ansible_tabs %}
{% block title %}Ansible Runs — Steward{% endblock %}
{% block content %}
{{ ansible_tabs("runs") }}
{% call page_header("Ansible Runs") %}
<a href="/ansible/playbooks" class="btn">Run a playbook</a>
{% endcall %}
{% set v = verdict %}
<p class="page-verdict">
{%- if not v.total %}<span class="tone-muted">No runs in the last {{ v.days }} days</span>
{%- elif v.failed %}<span class="tone-crit">{{ v.failed }} of {{ v.total }} run{{ 's' if v.total != 1 }} failed</span> in the last {{ v.days }} days
{%- if v.latest_failed %} — latest <a href="/ansible/runs/{{ v.latest_failed.run.id }}">{{ v.latest_failed.title }}</a> {{ v.latest_failed.run.started_at|ago }}{% endif %}
{%- else %}<span class="tone-ok">{{ v.total }} run{{ 's' if v.total != 1 }} in the last {{ v.days }} days, {{ 'all' if v.total > 1 else 'it' }} succeeded</span>{% endif %}
{%- if v.running %} · <span class="tone-info">{{ v.running }} running now</span>{% endif %}
{%- if v.next %} · next: <a href="/ansible/schedules/{{ v.next.id }}">{{ v.next.name }}</a> {% if v.next.at %}{{ v.next.at|ago }}{% else %}due now{% endif %}{% endif -%}
</p>
<form class="filter-bar" method="get" action="/ansible/" role="search"
hx-target="#runs-table" hx-push-url="true" hx-include="closest form">
<input type="search" name="q" value="{{ f.q }}" class="input" placeholder="Search playbooks"
aria-label="Search runs by playbook" autocomplete="off"
hx-get="/ansible/" hx-trigger="input changed delay:250ms, search">
<select name="status" aria-label="Status" hx-get="/ansible/" hx-trigger="change">
<option value="">Any status</option>
{% for key, (label, _) in statuses.items() %}<option value="{{ key }}"{% if f.status == key %} selected{% endif %}>{{ label }}</option>{% endfor %}
</select>
<select name="origin" aria-label="Started by" hx-get="/ansible/" hx-trigger="change">
<option value="">Started by anyone</option>
{% for key, label in origins.items() %}<option value="{{ key }}"{% if f.origin == key %} selected{% endif %}>{{ label }}</option>{% endfor %}
</select>
<noscript><button type="submit" class="btn btn-sm">Filter</button></noscript>
</form>
<div id="runs-table">{% include "ansible/_runs_table.html" %}</div>
{% endblock %}