webui: scope temperature alert highlighting
This commit is contained in:
@@ -1196,18 +1196,16 @@ function applyTempAlertStyles(data){
|
||||
});
|
||||
|
||||
const candidates = document.querySelectorAll(
|
||||
".card, .tile, .tempCard, .tempTile, .tempConfigCard, .reading, .sensor, .stat"
|
||||
".tempConfigCard, [id^='tempName'], [id^='tempAddress'], .temps, #temps, #tempConfigList > *"
|
||||
);
|
||||
|
||||
candidates.forEach(el => {
|
||||
const text = (el.textContent || "").toLowerCase();
|
||||
if (!text.includes("°") && !text.includes("temp") && !text.includes("fridge") && !text.includes("cabin")) {
|
||||
return;
|
||||
}
|
||||
const card = el.closest(".tempConfigCard") || el;
|
||||
const text = (card.textContent || "").toLowerCase();
|
||||
|
||||
for (const key of alertKeys) {
|
||||
if (key && text.includes(key)) {
|
||||
el.classList.add("temp-alert");
|
||||
card.classList.add("temp-alert");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user