Add new stat
Test FastAPI Startup / fastapi-up (push) Successful in 33s

This commit adds a new diagram in stats: a bar chart with hourly drinks from the database.
This commit is contained in:
2026-04-08 15:18:14 +02:00
parent e78ca6f21c
commit daa2d80397
3 changed files with 58 additions and 0 deletions
+2
View File
@@ -500,12 +500,14 @@ def stats(request: Request):
raise HTTPException(status_code=404, detail="User not found")
drink_types = db.models.get_stats_drink_types()
hourly_stats = db.models.get_stats_drink_hourly()
return templates.TemplateResponse("stats.html", {
"request": request,
"user": user_authentik,
"user_db_id": user_db_id,
"stats_drink_types": drink_types,
"stats_drink_hourly": hourly_stats,
})
@app.post("/add_drink_type")