From 0fb532d46fee813018d9e3a8a652a33268a71545 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 9 Apr 2026 17:29:46 +0000 Subject: [PATCH] Fix security reset UX: full-screen overlay, CSS class bug, and auto-reconnect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add security-reset-overlay HTML element to index.html that shows immediately when the user confirms "Erase & Reset", before the synchronous API call runs - Add .security-reset-overlay CSS to security.css (reuses reboot-card styles, adds fade-in animation, z-index 1000 to sit above all other content) - Fix reboot overlay class bug: classList.add("open") → classList.add("visible") so the overlay actually renders per the .reboot-overlay.visible CSS rule - Show overlay step text "Erasing data and resetting credentials…" during wipe, update to "Reset complete. Rebooting now…" when API returns - Call waitForServerReboot() (globally defined in update.js) after reset so the page auto-reloads when the system comes back online - Hide the security-reset-overlay and re-enable the button on error Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/185d0b41-d54d-4ea2-93d6-bfb7c15b8aed Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- .../static/css/security.css | 27 +++++++++++++++++++ .../static/js/security.js | 12 ++++++++- app/sovran_systemsos_web/templates/index.html | 19 +++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/app/sovran_systemsos_web/static/css/security.css b/app/sovran_systemsos_web/static/css/security.css index 7f8448c..ead06e8 100644 --- a/app/sovran_systemsos_web/static/css/security.css +++ b/app/sovran_systemsos_web/static/css/security.css @@ -215,6 +215,33 @@ min-width: 70px; } +/* ── Security Reset full-screen overlay ──────────────────────────── */ + +.security-reset-overlay { + display: none; + position: fixed; + inset: 0; + background-color: rgba(15, 15, 25, 0.94); + z-index: 1000; + align-items: center; + justify-content: center; + animation: security-reset-fade-in 0.35s ease-out; +} + +.security-reset-overlay.visible { + display: flex; +} + +@keyframes security-reset-fade-in { + from { opacity: 0; } + to { opacity: 1; } +} + +.security-reset-overlay-icon { + font-size: 3rem; + margin-bottom: 16px; +} + /* ── First-login security banner ─────────────────────────────────── */ .security-first-login-banner { diff --git a/app/sovran_systemsos_web/static/js/security.js b/app/sovran_systemsos_web/static/js/security.js index 3f357ad..13cac7c 100644 --- a/app/sovran_systemsos_web/static/js/security.js +++ b/app/sovran_systemsos_web/static/js/security.js @@ -119,12 +119,22 @@ function openSecurityModal() { if (!eraseInput || eraseInput.value.trim() !== "ERASE") return; resetConfirmBtn.disabled = true; resetConfirmBtn.textContent = "Erasing\u2026"; + + // Show the full-screen blocking overlay immediately so the user knows + // the wipe is in progress even while the API call runs synchronously. + var $secResetOverlay = document.getElementById("security-reset-overlay"); + var $secResetStep = document.getElementById("security-reset-overlay-step"); + if ($secResetOverlay) $secResetOverlay.classList.add("visible"); + if (resetStatus) { resetStatus.textContent = "Running security reset\u2026"; resetStatus.className = "security-status-msg security-status-info"; } try { await apiFetch("/api/security/reset", { method: "POST" }); + if ($secResetStep) $secResetStep.textContent = "Reset complete. Rebooting now\u2026"; if (resetStatus) { resetStatus.textContent = "\u2713 Reset complete. Rebooting\u2026"; resetStatus.className = "security-status-msg security-status-ok"; } - if ($rebootOverlay) $rebootOverlay.classList.add("open"); + if ($rebootOverlay) $rebootOverlay.classList.add("visible"); + setTimeout(waitForServerReboot, REBOOT_CHECK_INTERVAL); } catch (err) { + if ($secResetOverlay) $secResetOverlay.classList.remove("visible"); if (resetStatus) { resetStatus.textContent = "\u2717 Error: " + (err.message || "Reset failed."); resetStatus.className = "security-status-msg security-status-error"; } resetConfirmBtn.disabled = false; resetConfirmBtn.textContent = "Erase & Reset"; diff --git a/app/sovran_systemsos_web/templates/index.html b/app/sovran_systemsos_web/templates/index.html index fb51b38..907e2cc 100644 --- a/app/sovran_systemsos_web/templates/index.html +++ b/app/sovran_systemsos_web/templates/index.html @@ -210,6 +210,25 @@ + +
+