webui: scope temperature alert highlighting

This commit is contained in:
2026-06-12 01:22:30 -06:00
parent c210c563fd
commit c3b8cbbb74
@@ -1196,18 +1196,16 @@ function applyTempAlertStyles(data){
}); });
const candidates = document.querySelectorAll( const candidates = document.querySelectorAll(
".card, .tile, .tempCard, .tempTile, .tempConfigCard, .reading, .sensor, .stat" ".tempConfigCard, [id^='tempName'], [id^='tempAddress'], .temps, #temps, #tempConfigList > *"
); );
candidates.forEach(el => { candidates.forEach(el => {
const text = (el.textContent || "").toLowerCase(); const card = el.closest(".tempConfigCard") || el;
if (!text.includes("°") && !text.includes("temp") && !text.includes("fridge") && !text.includes("cabin")) { const text = (card.textContent || "").toLowerCase();
return;
}
for (const key of alertKeys) { for (const key of alertKeys) {
if (key && text.includes(key)) { if (key && text.includes(key)) {
el.classList.add("temp-alert"); card.classList.add("temp-alert");
return; return;
} }
} }