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