Change flow so home page is device select from where you can browse to overview
This commit is contained in:
13
app.py
13
app.py
@@ -56,10 +56,15 @@ def devices():
|
||||
return render_template('devices.html', devices=devices)
|
||||
|
||||
|
||||
@app.route("/overview")
|
||||
def overview():
|
||||
cadences = db.get_all_cadences()
|
||||
last_cadence = cadences[-1]['rpm']
|
||||
@ app.route("/device/<device_id>")
|
||||
def device(device_id):
|
||||
return render_template('device.html', device_id=device_id)
|
||||
|
||||
|
||||
@app.route("/overview/<device_id>")
|
||||
def overview(device_id):
|
||||
cadences = db.get_all_cadences(device_id)
|
||||
last_cadence = cadences[-1]['rpm'] if cadences else 0
|
||||
|
||||
graph_data = generate_graph([c['logged_at'] for c in cadences[::2]], [
|
||||
("RPM", [c['rpm'] for c in cadences[::2]])])
|
||||
|
||||
Reference in New Issue
Block a user