webui: scope temperature alert highlighting
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user