From 8cf24308185d45000b1ce6f29a2edc6cdf00185c Mon Sep 17 00:00:00 2001 From: Matt Kohls Date: Mon, 4 Dec 2023 22:44:20 -0500 Subject: Adding JS graphs to dashboard Using new api + D3 and Plot to draw fancy graphs --- snag/dashboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'snag/dashboard.py') diff --git a/snag/dashboard.py b/snag/dashboard.py index 7e77124..1eca82c 100644 --- a/snag/dashboard.py +++ b/snag/dashboard.py @@ -16,11 +16,11 @@ def dashboard(): db = get_db() rows = db.execute( - 'SELECT de.deviceId, de.environment, d.deviceName' + 'SELECT de.deviceId, de.environment, de.environmentDescription, d.deviceName, d.deviceLocation' ' FROM device_env de JOIN devices d ON de.deviceId = d.deviceId' ' ORDER BY entry DESC' ).fetchall() - deviceList = [dict(deviceId=row['deviceId'], location=row['environment'], name=row['deviceName']) for row in rows] + deviceList = [dict(deviceId=row['deviceId'], environment=row['environment'], environmentDesc=row['environmentDescription'], name=row['deviceName'], location=row['deviceLocation']) for row in rows] return render_template('dashboard/dashboard.html', deviceList=deviceList, generatedAt=datetime.now()) -- cgit v1.2.3