From 1b7e1bfee4023085b2a14049d2f02b3e1c0821b2 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Thu, 14 May 2026 19:50:24 -0400 Subject: [PATCH] imaging: pause page auto-refresh while a LAPS QR is showing meta http-equiv=refresh fires every 5s and reloads the entire page, wiping the LAPS QR state mid-scan. Replaced the meta tag with a JS-driven setTimeout(location.reload, 5000) so renderLapsQR() can clearTimeout it. Reload resumes when the QR is cleared (manual or 60s auto). Multi-bay safety: only resumes if no other bay still has a QR rendered. Co-Authored-By: Claude Opus 4.7 (1M context) --- webapp/templates/imaging.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/webapp/templates/imaging.html b/webapp/templates/imaging.html index d5a6a31..6e98efa 100644 --- a/webapp/templates/imaging.html +++ b/webapp/templates/imaging.html @@ -2,7 +2,18 @@ {% block title %}Imaging Progress - PXE Server Manager{% endblock %} {% block extra_head %} - +{# JS-driven refresh instead of meta http-equiv so we can cancel it while a #} +{# LAPS-password QR is showing (otherwise the 5s reload wipes the in-page #} +{# state every cycle). #} + {% endblock %} {% block content %} @@ -240,6 +251,7 @@ function renderLapsQR(card) { container.innerHTML = qr.createImgTag(cellSize, 4); makeBtn.style.display = 'none'; clearBtn.style.display = ''; + cancelImagingReload(); // freeze page refresh while QR is visible var remaining = 60; timerEl.textContent = '(auto-clears in ' + remaining + 's)'; if (card._lapsTimer) clearInterval(card._lapsTimer); @@ -264,6 +276,10 @@ function clearLapsQR(card) { timerEl.textContent = ''; makeBtn.style.display = ''; clearBtn.style.display = 'none'; + // Resume page refresh now that no QR is showing on any card. + if (!document.querySelector('.laps-qr-container img')) { + scheduleImagingReload(); + } } document.addEventListener('click', function(e) { var card;