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>
This commit is contained in:
@@ -32,12 +32,14 @@ async def test_maintenance_offers_changes_only_to_those_who_can_make_them(app):
|
||||
|
||||
async def test_schedules_show_a_viewer_the_list_without_its_controls(app):
|
||||
s = NS(id="s1", name="nightly", enabled=True, source_name="local", playbook_path="prune.yml",
|
||||
inventory_scope="steward:all", interval_seconds=7200, last_error=None, last_run_at=None)
|
||||
rows = [{"s": s, "last_run": None, "next_run": NOW + timedelta(hours=2), "scope_label": "all inventory targets"}]
|
||||
inventory_scope="steward:all", interval_seconds=7200, last_error=None, last_run_at=None, params=None)
|
||||
nxt = {"id": "s1", "name": "nightly", "at": NOW + timedelta(hours=2)}
|
||||
rows = [{"s": s, "last_run": None, "next": nxt, "scope_label": "all inventory targets"}]
|
||||
async with app.test_request_context("/ansible/schedules"):
|
||||
session["user_role"] = "viewer"
|
||||
page = await render_template("ansible/schedules.html", rows=rows, editing=None)
|
||||
page = await render_template("ansible/schedules.html", rows=rows, next=nxt, failing=0, paused=0)
|
||||
assert "nightly" in page and "every 2h" in page and "7200s" not in page
|
||||
assert ">in 2h</time>" in page or ">in 1h 59m</time>" in page
|
||||
for control in ("Run now", "Pause", "?edit=", "/delete", "New schedule"):
|
||||
assert 'class="row-target" href="/ansible/schedules/s1"' in page # the row opens the schedule
|
||||
for control in ("Run now", "Pause", "/delete", "New schedule"):
|
||||
assert control not in page, control
|
||||
|
||||
Reference in New Issue
Block a user