diff --git a/app.py b/app.py index 7a271c5..29ab326 100644 --- a/app.py +++ b/app.py @@ -58,7 +58,8 @@ def devices(): @ app.route("/device/") def device(device_id): - return render_template('device.html', device_id=device_id) + device = db.get_device(device_id) + return render_template('device.html', device=device) @app.route("/overview/") diff --git a/db.py b/db.py index a79b13e..58ef380 100644 --- a/db.py +++ b/db.py @@ -56,3 +56,6 @@ class DataBase(): GROUP BY DEVICE.ID ORDER BY LAST_LOGGED_AT """) + + def get_device(self, device_id): + return self.execute('SELECT * FROM device WHERE id = %s', [device_id], one=True) diff --git a/templates/device.html b/templates/device.html index d51d1f1..3c3ab7c 100644 --- a/templates/device.html +++ b/templates/device.html @@ -1,4 +1,35 @@ -
+ + +
-

{{last_cadence}} rpm