Merge pull request #174 from naturallaw777/copilot/fix-security-reset-user-experience
[WIP] Improve user feedback during security reset process
This commit is contained in:
@@ -215,6 +215,33 @@
|
|||||||
min-width: 70px;
|
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 ─────────────────────────────────── */
|
/* ── First-login security banner ─────────────────────────────────── */
|
||||||
|
|
||||||
.security-first-login-banner {
|
.security-first-login-banner {
|
||||||
|
|||||||
@@ -119,12 +119,22 @@ function openSecurityModal() {
|
|||||||
if (!eraseInput || eraseInput.value.trim() !== "ERASE") return;
|
if (!eraseInput || eraseInput.value.trim() !== "ERASE") return;
|
||||||
resetConfirmBtn.disabled = true;
|
resetConfirmBtn.disabled = true;
|
||||||
resetConfirmBtn.textContent = "Erasing\u2026";
|
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"; }
|
if (resetStatus) { resetStatus.textContent = "Running security reset\u2026"; resetStatus.className = "security-status-msg security-status-info"; }
|
||||||
try {
|
try {
|
||||||
await apiFetch("/api/security/reset", { method: "POST" });
|
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 (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) {
|
} 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"; }
|
if (resetStatus) { resetStatus.textContent = "\u2717 Error: " + (err.message || "Reset failed."); resetStatus.className = "security-status-msg security-status-error"; }
|
||||||
resetConfirmBtn.disabled = false;
|
resetConfirmBtn.disabled = false;
|
||||||
resetConfirmBtn.textContent = "Erase & Reset";
|
resetConfirmBtn.textContent = "Erase & Reset";
|
||||||
|
|||||||
@@ -210,6 +210,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Security Reset overlay -->
|
||||||
|
<div class="security-reset-overlay" id="security-reset-overlay">
|
||||||
|
<div class="reboot-card">
|
||||||
|
<div class="security-reset-overlay-icon">🛡</div>
|
||||||
|
<h2 class="reboot-title">Security Reset In Progress</h2>
|
||||||
|
<p class="reboot-message">
|
||||||
|
⚠️ Wiping all data and credentials.<br />
|
||||||
|
<strong>Do not power off your computer.</strong><br />
|
||||||
|
This may take several minutes. The system will reboot automatically when complete.
|
||||||
|
</p>
|
||||||
|
<div class="reboot-dots">
|
||||||
|
<span class="reboot-dot"></span>
|
||||||
|
<span class="reboot-dot"></span>
|
||||||
|
<span class="reboot-dot"></span>
|
||||||
|
</div>
|
||||||
|
<p class="reboot-submessage" id="security-reset-overlay-step">Erasing data and resetting credentials…</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Reboot overlay -->
|
<!-- Reboot overlay -->
|
||||||
<div class="reboot-overlay" id="reboot-overlay">
|
<div class="reboot-overlay" id="reboot-overlay">
|
||||||
<div class="reboot-card">
|
<div class="reboot-card">
|
||||||
|
|||||||
Reference in New Issue
Block a user