Tank level in red inf below limit
This commit is contained in:
parent
1c603a5cb1
commit
dd6cc73cf0
|
|
@ -596,13 +596,19 @@
|
||||||
if (dsData) {
|
if (dsData) {
|
||||||
const tankLevelElement = document.querySelector("#TankLevel .monitor-value");
|
const tankLevelElement = document.querySelector("#TankLevel .monitor-value");
|
||||||
const qconsoElement = document.querySelector("#Qconso .monitor-value");
|
const qconsoElement = document.querySelector("#Qconso .monitor-value");
|
||||||
|
|
||||||
if (tankLevelElement) {
|
if (tankLevelElement) {
|
||||||
tankLevelElement.innerHTML = `<br>${dsData.TankLevel.toFixed(1)}`;
|
const tankLevelValue = dsData.TankLevel;
|
||||||
} else {
|
tankLevelElement.innerHTML = `<br>${tankLevelValue.toFixed(1)} %`;
|
||||||
console.error('Element with selector "#TankLevel .monitor-value" not found.');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// ✅ Make it red if below 35
|
||||||
|
if (tankLevelValue < 35) {
|
||||||
|
tankLevelElement.style.color = "red";
|
||||||
|
tankLevelElement.style.fontWeight = "bold";
|
||||||
|
} else {
|
||||||
|
tankLevelElement.style.color = "white"; // reset to normal
|
||||||
|
tankLevelElement.style.fontWeight = "normal";
|
||||||
|
}
|
||||||
|
}
|
||||||
if (qconsoElement) {
|
if (qconsoElement) {
|
||||||
qconsoElement.innerHTML = `<br>${dsData.Qconso.toFixed(1)} L/h`;
|
qconsoElement.innerHTML = `<br>${dsData.Qconso.toFixed(1)} L/h`;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -610,6 +616,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching monitor data:', error);
|
console.error('Error fetching monitor data:', error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user