{# Rollback points for one application, as one swappable section. Two states render through this fragment: the list of backups the application can return to, and the confirmation over one of them. Rolling back overwrites the deployed files, so the confirmation is not a browser dialog that habit clicks through - the operator types the domain, and the name is checked server-side. A wrong name renders the refusal inline at 200, because htmx does not swap an error status, and changes nothing. The rollback itself is the existing job the JSON API queues; this section only offers it. Progress is reported by the live feed and the activity screen, like every queued job. #} {% import "_macros.html" as m %}
{% if rollback_problem %} {{ m.problem(rollback_problem.fix, rollback_problem.output) }} {% endif %} {% if rollback_queued %}

{{ m.badge("busy", "queued") }} {{ rollback_queued }} is queued. Progress is reported by the live feed and the activity screen.

{% endif %} {% if rollback_mode == "confirm" and rollback_confirm %}

Roll {{ rollback_domain }} back to {{ rollback_confirm.id }} (taken {{ rollback_confirm.taken }}, {{ rollback_confirm.size }})? This overwrites the files currently deployed at {{ rollback_domain }} and cannot be undone.

{% elif rollback_points %} {% for point in rollback_points %} {% call m.row(point.id, "idle", [("taken", point.taken), ("size", point.size), ("tags", point.tags)], none, "rollback-" ~ point.id, point.note) %} {% endcall %} {% endfor %} {% else %}

No rollback points exist for {{ rollback_domain }}. A backup is taken before every deploy; the next one creates the first point to return to.

{% endif %}