From 486aa2ff187b4d455aec07568f82a91a8fa50519 Mon Sep 17 00:00:00 2001 From: SimolZimol <70102430+SimolZimol@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:09:31 +0200 Subject: [PATCH] modified: web/blueprints/panel.py modified: web/static/css/style.css modified: web/templates/base.html modified: web/templates/panel/dashboard.html --- web/blueprints/panel.py | 12 +++++++++- web/static/css/style.css | 29 +++++++++++++++++++++--- web/templates/base.html | 36 +++++++++++++++--------------- web/templates/panel/dashboard.html | 2 +- 4 files changed, 56 insertions(+), 23 deletions(-) diff --git a/web/blueprints/panel.py b/web/blueprints/panel.py index 7eee9f4..8951252 100644 --- a/web/blueprints/panel.py +++ b/web/blueprints/panel.py @@ -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) # ───────────────────────────────────────────────────────────── diff --git a/web/static/css/style.css b/web/static/css/style.css index 1753b98..8bbc6ad 100644 --- a/web/static/css/style.css +++ b/web/static/css/style.css @@ -44,14 +44,37 @@ html, body { #sidebar.collapsed { width: 64px; min-width: 64px; + padding: .75rem .5rem !important; } #sidebar.collapsed .sidebar-brand div, #sidebar.collapsed .sidebar-brand small, -#sidebar.collapsed .nav-link span { +#sidebar.collapsed .sidebar-brand .badge, +#sidebar.collapsed .nav-link span, +#sidebar.collapsed .sidebar-hide-collapsed, +#sidebar.collapsed .btn span { display: none; } +#sidebar.collapsed .nav-link { + justify-content: center; + padding: .55rem; +} + +#sidebar.collapsed .nav-link i { + font-size: 1.15rem; + margin: 0; +} + +#sidebar.collapsed .btn { + padding: .35rem; + text-align: center; +} + +#sidebar.collapsed .btn i { + margin: 0; +} + .sidebar-brand { padding: .25rem 0; } @@ -143,11 +166,11 @@ main { /* ── Tabellen ────────────────────────────────────────────── */ .table { color: #d1d5db; - font-size: .8rem; + font-size: .875rem; } .table > thead { - font-size: .75rem; + font-size: .8rem; letter-spacing: .03em; color: #9ca3af; } diff --git a/web/templates/base.html b/web/templates/base.html index ce03c8e..b5f703e 100644 --- a/web/templates/base.html +++ b/web/templates/base.html @@ -27,80 +27,80 @@ {% if perms.get('view_dashboard', True) or is_admin %}