modified: web/blueprints/panel.py

modified:   web/static/css/style.css
	modified:   web/templates/base.html
	modified:   web/templates/panel/dashboard.html
This commit is contained in:
SimolZimol
2026-04-02 00:09:31 +02:00
parent df8a0590b9
commit 486aa2ff18
4 changed files with 56 additions and 23 deletions

View File

@@ -139,13 +139,23 @@ def dashboard():
WHERE timestamp >= NOW() - INTERVAL 24 HOUR
ORDER BY timestamp DESC LIMIT 20
""")
block_chart = query("""
SELECT DATE(timestamp) AS day, COUNT(*) AS cnt
FROM block_events
WHERE timestamp >= NOW() - INTERVAL 7 DAY
GROUP BY DATE(timestamp) ORDER BY day
""")
recent = query("""
SELECT * FROM v_recent_activity LIMIT 50
""")
except Exception as e:
flash(f"Database error: {e}", "danger")
return render_template("panel/no_db.html")
return render_template("panel/dashboard.html",
stats=stats, online=online, top_players=top_players,
death_causes=death_causes, server_events=server_events)
death_causes=death_causes, server_events=server_events,
block_chart=block_chart, recent=recent)
# ─────────────────────────────────────────────────────────────