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:
@@ -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)
|
||||
|
||||
|
||||
# ─────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user