Merge remote-tracking branch 'origin/main'

This commit is contained in:
Etienne Chassaing 2025-08-06 11:53:51 +02:00
commit f6180386d1
2 changed files with 11 additions and 9 deletions

View File

@ -294,7 +294,8 @@ async def update_latest_data():
@app.get("/monitor")
async def get_monitor_data():
return JSONResponse(content=latest_data)
return latest_data
# return JSONResponse(content=latest_data)
# LOCAL RECORDER

View File

@ -523,14 +523,6 @@
const dataResponse = await fetch('/monitor');
const allData = await dataResponse.json();
// Update Tank Level and Qconso
const dsData = allData["DS"];
if (dsData) {
document.querySelector("#TankLevel .monitor-value").innerHTML = `DS<br>${dsData.TankLevel.toFixed(1)}`;
const qconso = dsData.Qinlet - dsData.Qoutlet;
document.querySelector("#Qconso .monitor-value").innerHTML = `DS<br>${qconso.toFixed(1)} L/h`;
}
for (const [fieldId, unit] of Object.entries(fields)) {
const container = document.getElementById(fieldId);
if (!container) continue;
@ -543,6 +535,15 @@
}
});
}
// Update Tank Level and Qconso
const dsData = allData["DS"];
if (dsData) {
document.querySelector("#TankLevel .monitor-value").innerHTML = `DS<br>${dsData.TankLevel.toFixed(1)}`;
const qconso = dsData.Qinlet - dsData.Qoutlet;
document.querySelector("#Qconso .monitor-value").innerHTML = `DS<br>${qconso.toFixed(1)} L/h`;
}
} catch (error) {
console.error('Error fetching monitor data:', error);
}