{% extends "base.html" %} {% block title %}Review restore{% endblock %} {% block content %}

Review restore

Backup: {{ review.backup_id }}

{# A GET form, deliberately -- switching mode must *re-stage*, not edit a field in the apply form. The plan fingerprint covers the mode, so a mode changed after staging would be refused as stale; worse, a hidden field an operator could flip would mean applying an operation whose warnings and step list they were never shown. Reloading re-runs preflight and re-renders the whole page for the mode actually chosen. Without this the destructive mode was reachable only by hand-editing the query string -- see plan section 4.3, which specified a mode select. #}
{% if error %}
{{ error }}
{% endif %} {% if review.mode == "in_place" %}
This replaces live data in {{ review.target_schema }}. A safety backup is taken first and the current schema is renamed aside rather than dropped, so a failure at any point before verification passes restores the original. It is still a destructive operation.
{% else %}
This restores into {{ review.target_database }}, a separate database. Live data is not touched.
{% endif %}

What will happen

    {% for step in review.steps %}
  1. {{ step }}
  2. {% endfor %}

Preflight

{% if review.blocking %}
This restore cannot proceed until the following are resolved.
{% endif %} {% for check in review.checks %} {% endfor %}
CheckResultDetail
{{ check.id }} {{ check.status }} {{ check.detail }}

Confirm

{% if review.blocking %}

Apply is unavailable while preflight is failing.

{% else %} {# Only ask for the typed label when apply will actually check it. Asking otherwise would assert a control the service does not enforce -- the operator would reasonably infer their typing is what authorises this. #} {% if review.confirmation_required %}

To proceed, type the target label exactly:
{{ review.required_confirm_target }}

{% else %}

This restore does not touch live data, so no typed confirmation is required.

{% endif %}
{# The fingerprint pins this exact plan. Apply re-stages and compares, so a change between rendering and submitting is refused rather than silently applying something the operator never saw. #} {% if review.options.target_database %} {% endif %} {% if review.confirmation_required %} {% endif %} {% if review.mode == "in_place" %} {% endif %}
{% if review.confirmation_required %} {# Progressive enhancement only. The server re-checks the typed label and the fingerprint regardless, so disabling the button is a courtesy, not the control. #} {% endif %} {% endif %}

Back to backups

Plan fingerprint: {{ review.plan_fingerprint }}

{% endblock %}