Files

35 lines
1.2 KiB
HTML
Raw Permalink Normal View History

2026-09-18 12:03:35 +02:00
{{define "title"}}{{ tr "Updated to" }} {{ .Target }} · {{ tr "Volumen admin" }}{{end}}
{{define "content"}}
<div class="empty narrow">
<svg aria-hidden="true"><use href="/admin/assets/graphis.svg#refresh"></use></svg>
<h1>{{ tr "Updated to" }} {{ .Target }}</h1>
<p class="empty__note" id="update-status" role="status">{{ tr "The server is restarting. This page will reload automatically." }}</p>
<div class="spinner" aria-hidden="true"></div>
</div>
<script nonce="{{ .CSPNonce }}">
/* Wait for the engine to come back by polling its own health endpoint,
never by a guessed delay. */
(() => {
const status = document.getElementById("update-status");
let attempts = 0;
const timer = setInterval(async () => {
attempts += 1;
try {
const response = await fetch("/healthz", { cache: "no-store" });
if (response.ok) {
clearInterval(timer);
status.textContent = window.__("update.reload");
setTimeout(() => { window.location.href = "/admin/"; }, 500);
return;
}
} catch (error) { /* still down */ }
if (attempts > 60) {
clearInterval(timer);
status.textContent = window.__("update.gaveup");
}
}, 3000);
})();
</script>
{{end}}