From 7b9d19425f6012910d521d5a42449cc8de21cdf2 Mon Sep 17 00:00:00 2001 From: Wladymir Brborich Date: Tue, 24 Dec 2024 14:10:30 +0100 Subject: [PATCH] Fix template bug and update dashboard --- dashboard/dashboard.json | 21 +++++++++++++-------- server/app/managers/aiq_manager.py | 2 +- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dashboard/dashboard.json b/dashboard/dashboard.json index 39eedb4..67d455c 100644 --- a/dashboard/dashboard.json +++ b/dashboard/dashboard.json @@ -342,7 +342,7 @@ }, { "color": "red", - "value": 80 + "value": 28 } ] }, @@ -557,7 +557,7 @@ "mode": "none" }, "thresholdsStyle": { - "mode": "off" + "mode": "dashed" } }, "mappings": [], @@ -571,7 +571,7 @@ }, { "color": "red", - "value": 80 + "value": 1500 } ] }, @@ -948,7 +948,7 @@ "mode": "palette-classic" }, "custom": { - "axisBorderShow": false, + "axisBorderShow": true, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", @@ -977,10 +977,11 @@ "mode": "none" }, "thresholdsStyle": { - "mode": "off" + "mode": "dashed" } }, "mappings": [], + "max": 100, "min": 0, "thresholds": { "mode": "absolute", @@ -1856,6 +1857,7 @@ "mode": "off" } }, + "fieldMinMax": false, "mappings": [], "thresholds": { "mode": "absolute", @@ -1869,7 +1871,8 @@ "value": 80 } ] - } + }, + "unit": "conppb" }, "overrides": [] }, @@ -2010,6 +2013,8 @@ "fieldConfig": { "defaults": { "mappings": [], + "max": 5, + "min": 1, "thresholds": { "mode": "percentage", "steps": [ @@ -2213,13 +2218,13 @@ ] }, "time": { - "from": "now-15m", + "from": "now-4d", "to": "now" }, "timepicker": {}, "timezone": "", "title": "AIQ Data Dashboard", "uid": "c5fa12e4-5d12-4cb0-8abb-342a0db016fd", - "version": 2, + "version": 4, "weekStart": "" } \ No newline at end of file diff --git a/server/app/managers/aiq_manager.py b/server/app/managers/aiq_manager.py index 18e2acf..b2d18f2 100644 --- a/server/app/managers/aiq_manager.py +++ b/server/app/managers/aiq_manager.py @@ -74,8 +74,8 @@ def _render_summary_template(data: StationData, count: int) -> str: SVM41_SUMMARY_TEMPLATE.format( int(data.svm41_data.temperature) / 1000000, int(data.svm41_data.humidity) / 1000000, - int(data.svm41_data.voc_index) / 1000000, int(data.svm41_data.nox_index) / 1000000, + int(data.svm41_data.voc_index) / 1000000, ) if data.svm41_data is not None else ""