45 lines
2.0 KiB
HTML
45 lines
2.0 KiB
HTML
{% extends "admin_base.html" %}
|
|
{% block admin_content %}
|
|
{% if request.query_params.get('purged') %}
|
|
<p class="ok">
|
|
<span data-i18n="admin.flash.purgedPrefix">Purged</span>
|
|
{{ request.query_params.get('wraps', '0') }}
|
|
<span data-i18n="admin.flash.purgedWraps">wrap(s) and</span>
|
|
{{ request.query_params.get('objects', '0') }}
|
|
<span data-i18n="admin.flash.purgedObjects">object(s).</span>
|
|
</p>
|
|
{% endif %}
|
|
{% if request.query_params.get('purge') == 'confirm' %}
|
|
<p class="error" data-i18n="admin.flash.purgeConfirm">Type PURGE to confirm forced cleanup.</p>
|
|
{% endif %}
|
|
{% if request.query_params.get('purge') == 'error' %}
|
|
<p class="error" data-i18n="admin.flash.purgeError">Purge failed. Check logs / MinIO connectivity.</p>
|
|
{% endif %}
|
|
|
|
<section class="admin-section danger-zone danger-page">
|
|
<p class="hint" data-i18n="admin.danger.hint">Force-delete all wraps from the database and all ciphertext objects in MinIO (wraps/). Audit log is kept. This cannot be undone.</p>
|
|
<form method="post" action="/admin/purge" class="purge-form" id="purge-form">
|
|
<label>
|
|
<span data-i18n="admin.danger.confirmLabel">Type PURGE to confirm</span>
|
|
<input name="confirm" type="text" autocomplete="off" placeholder="PURGE" required />
|
|
</label>
|
|
<button class="btn danger" type="submit" data-i18n="admin.danger.submit">Clear all wraps & files</button>
|
|
</form>
|
|
</section>
|
|
<script>
|
|
document.getElementById("purge-form")?.addEventListener("submit", async (e) => {
|
|
e.preventDefault();
|
|
const form = e.target;
|
|
const ok = await window.WrappedModal.confirm({
|
|
title: window.WrappedI18n?.t("admin.danger.confirmTitle") || "Danger zone",
|
|
message: window.WrappedI18n?.t("admin.danger.confirmDialog")
|
|
|| "Delete ALL wraps and files? This cannot be undone.",
|
|
confirmLabel: window.WrappedI18n?.t("admin.danger.confirmOk") || "Delete everything",
|
|
cancelLabel: window.WrappedI18n?.t("modal.confirm.cancel") || "Cancel",
|
|
danger: true,
|
|
});
|
|
if (ok) form.submit();
|
|
});
|
|
</script>
|
|
{% endblock %}
|