Fix scan status detection and add stop button in header

This commit is contained in:
2026-01-01 17:33:24 +11:00
parent 7e2fc7edce
commit b1430f058c
3 changed files with 47 additions and 33 deletions

View File

@@ -209,6 +209,7 @@ let statusInterval = null;
async function checkScanStatus() {
const statusBadge = document.getElementById("scan-status");
const stopBtn = document.getElementById("stop-scan-btn");
if (!statusBadge) return;
try {
@@ -218,10 +219,12 @@ async function checkScanStatus() {
if (result.running) {
statusBadge.className = "status-badge status-running";
statusBadge.innerHTML = '<span class="spinner"></span> Scan Running';
if (stopBtn) stopBtn.style.display = "inline-flex";
startStatusPolling();
} else {
statusBadge.className = "status-badge status-idle";
statusBadge.textContent = "Idle";
if (stopBtn) stopBtn.style.display = "none";
stopStatusPolling();
}
} catch (error) {