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:
@@ -83,7 +83,7 @@ async def test_a_playbook_page_runs_it_and_shows_its_history(app):
|
||||
session["user_role"] = "operator"
|
||||
page = await render_template("ansible/playbook.html", **_page_ctx(schedules=[
|
||||
{"s": sched, "scope_label": "group Docker Swarm",
|
||||
"next": {"name": "Nightly prune", "at": now + timedelta(hours=2)}}]))
|
||||
"next": {"id": "s1", "name": "Nightly prune", "at": now + timedelta(hours=2)}}]))
|
||||
main = page[page.index("<main"):]
|
||||
assert 'href="/ansible/playbooks"' in page # crumbs back to the list
|
||||
verdict = main[main.index('<p class="page-verdict">'):]
|
||||
@@ -93,7 +93,8 @@ async def test_a_playbook_page_runs_it_and_shows_its_history(app):
|
||||
assert 'name="confirmed"' in main # the destructive flag's gate
|
||||
assert 'name="var__prune_volumes"' in main and 'name="check"' in main
|
||||
assert "Nightly prune" in main and "on group Docker Swarm · daily" in main
|
||||
assert 'href="/ansible/schedules?edit=s1#form"' in main
|
||||
assert 'href="/ansible/schedules/s1"' in main
|
||||
assert 'href="/ansible/schedules/new?source=steward-builtin&playbook=maintenance/prune.yml"' in main
|
||||
assert 'href="/ansible/runs/r9"' in main and "End of the list." not in main
|
||||
assert 'href="/ansible/?q=maintenance/prune.yml"' in main
|
||||
assert "/ansible/playbooks/edit/" not in main # a built-in playbook is read-only
|
||||
|
||||
Reference in New Issue
Block a user