From d2ac10aa606b714158a20b61473f4a1864d7c0c5 Mon Sep 17 00:00:00 2001 From: thomasciesla Date: Tue, 30 Dec 2025 14:46:55 +0100 Subject: [PATCH] jtl-wafi-dashboard.py aktualisiert --- jtl-wafi-dashboard.py | 95 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 15 deletions(-) diff --git a/jtl-wafi-dashboard.py b/jtl-wafi-dashboard.py index af16b3f..99fe123 100644 --- a/jtl-wafi-dashboard.py +++ b/jtl-wafi-dashboard.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -JTL-WAFi Dashboard v3.0.0 - WebSocket Real-Time Dashboard +JTL-WAFi Dashboard v3.1.0 - WebSocket Real-Time Dashboard Features: - Bot Rate-Limiting: Bots nach Rate-Limit bannen @@ -11,8 +11,11 @@ Features: - PHP-FPM Restart: OPcache automatisch leeren - Alle Agent/Shop-Daten im Memory - DB nur fรผr: Passwort, Tokens, Sessions +- IP Ban/Whitelist: IPs manuell bannen oder whitelisten +- Live Stats: Top IPs, Top Requests, Suspicious IPs +- Auto-Ban: Automatische IP-Bans bei verdรคchtigem Verhalten -v3.0.0: Auto-Update, FPM-Restart, Country-Detection Bugfix +v3.1.0: IP Ban/Whitelist, Enhanced Live Logs, Human/Bot Stats Split """ import os @@ -36,7 +39,7 @@ import uvicorn # ============================================================================= # VERSION & CONFIG # ============================================================================= -VERSION = "3.0.0" +VERSION = "3.1.0" DATA_DIR = "/var/lib/jtl-wafi" SSL_DIR = "/var/lib/jtl-wafi/ssl" @@ -1442,7 +1445,27 @@ def get_dashboard_html() -> str: .btn-icon:hover { border-color: var(--accent); color: var(--accent); } .actions { display: flex; gap: 8px; align-items: center; } .logs-panel { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-secondary); border-top: 1px solid var(--border); height: 300px; transform: translateY(100%); transition: transform 0.3s ease; z-index: 200; } + .logs-panel.enhanced { height: 400px; } .logs-panel.open { transform: translateY(0); } + .logs-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; height: calc(100% - 50px); padding: 12px; } + .logs-column { background: var(--card-bg); border-radius: 8px; padding: 8px; overflow-y: auto; } + .logs-column-header { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); } + .logs-feed .logs-content { height: calc(100% - 30px); overflow-y: auto; } + .top-ips-list, .suspicious-ips-list, .top-requests-list, .top-blocked-list { font-size: 11px; } + .ip-item, .request-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; border-radius: 4px; margin-bottom: 4px; background: var(--bg); } + .ip-item:hover { background: var(--border); } + .ip-item .ip-info { display: flex; flex-direction: column; gap: 2px; flex: 1; } + .ip-item .ip-addr { font-family: monospace; font-weight: 500; } + .ip-item .ip-meta { font-size: 10px; color: var(--text-secondary); } + .ip-item .ip-count { font-weight: 600; color: var(--accent); margin-right: 8px; } + .ip-item .ip-actions { display: flex; gap: 4px; } + .ip-item .ip-actions button { padding: 2px 6px; font-size: 10px; border-radius: 3px; border: none; cursor: pointer; } + .ip-item .btn-ban { background: var(--danger); color: white; } + .ip-item .btn-whitelist { background: var(--success); color: white; } + .suspicious-item { background: rgba(255,71,87,0.1); border-left: 3px solid var(--danger); } + .suspicious-item .ip-count { color: var(--danger); } + .request-item .request-path { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; } + .request-item .request-count { font-weight: 600; color: var(--accent); } .logs-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); } .logs-content { height: calc(100% - 48px); overflow-y: auto; padding: 12px 20px; font-family: monospace; font-size: 12px; line-height: 1.6; } .log-entry { color: var(--text-secondary); } @@ -1482,12 +1505,12 @@ def get_dashboard_html() -> str:
- +
--:--:--
Verbinde...
Update:
-
+
Abmelden
@@ -1497,8 +1520,8 @@ def get_dashboard_html() -> str:
Shops Aktiv
0
๐Ÿ›ก๏ธ Link11
0
โšก Direkt
0
-
Requests/min
0
-
Aktive Bans
0
+
Human/min
0
+
Bot/min
0
@@ -1525,13 +1548,46 @@ def get_dashboard_html() -> str:
Statusโ‡…Domainโ‡…Serverโ‡…Modusโ‡…Req/minโ‡…Bansโ‡…Laufzeitโ‡…Aktionen
-
๐Ÿ“œ Live Logs: -
+
+
+ ๐Ÿ“œ Live Logs: - +
+ + + +
+
+
+
+
๐Ÿ“ Live Feed
+
+
+
+
๐Ÿ” Top IPs
+
+
โš ๏ธ Suspicious IPs
+
+
+
+
๐Ÿ“Š Top Requests
+
+
๐Ÿšซ Top Blocked
+
+
+
+
- +