From efd44dbf3eac460c131743c61dea676f2ec7d8c4 Mon Sep 17 00:00:00 2001 From: aniketSaha Date: Tue, 5 Aug 2025 13:23:03 +0200 Subject: [PATCH] updates to html page --- main.py | 6 +- static/monitor.html | 338 +++++++++++++++++++++++--------------------- 2 files changed, 178 insertions(+), 166 deletions(-) diff --git a/main.py b/main.py index addd49d..0d2cbc1 100644 --- a/main.py +++ b/main.py @@ -31,7 +31,7 @@ if platform.system() in ["Darwin"]: # macOS or Windows else: from classCAN import CANBackend # Your real backend - logging.basicConfig(level=logging.INFO) + logging.basicConfig(level=logging.DEBUG) logging.getLogger("uvicorn.access").setLevel(logging.WARNING) @@ -392,6 +392,7 @@ async def auto_test_pu3(): # PATIENT SKID HELPERS async def update_latest_flow(): + global active_PUs async with aiohttp.ClientSession() as session: while True: try: @@ -400,6 +401,9 @@ async def update_latest_flow(): latest_flow = int(data["log"]["flow"]) logging.debug(f"Updated flow: {latest_flow}") latest_data["PatientSkid"]["QSkid"] = latest_flow + # for index in active_PUs : + # logging.debug("PU_"+str(index)) + # latest_data["PU_"+str(index)]["QSkid"] = latest_flow # Adding the data to all actives PUs except Exception as e: logging.error(f"Error fetching flow: {e}") diff --git a/static/monitor.html b/static/monitor.html index a2571f4..03ed292 100644 --- a/static/monitor.html +++ b/static/monitor.html @@ -1,8 +1,9 @@ + - + Live Monitoring Dashboard +

Live Monitoring Dashboard

@@ -50,198 +57,199 @@
-
-
+
+
+
-
-
-
+
+
- + window.onload = function () { + initPlots(); + fetchPUStatus(); + setInterval(fetchPUStatus, 5000); + }; + - + + \ No newline at end of file