From 55061bb29e7424ed80cd190bcb471f990e37b2f2 Mon Sep 17 00:00:00 2001 From: Thomas Ciesla Date: Fri, 9 Jan 2026 13:03:35 +0100 Subject: [PATCH] clickable ips to whois --- jtl-wafi-dashboard.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jtl-wafi-dashboard.py b/jtl-wafi-dashboard.py index d46294f..d699832 100644 --- a/jtl-wafi-dashboard.py +++ b/jtl-wafi-dashboard.py @@ -1530,7 +1530,8 @@ def get_dashboard_html() -> str: .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-addr { font-family: monospace; font-weight: 500; color: var(--accent); text-decoration: none; } + .ip-item .ip-addr:hover { text-decoration: underline; } .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; } @@ -1736,8 +1737,8 @@ def get_dashboard_html() -> str: function changeStatsWindow(w){currentStatsWindow=w;requestLiveStats();} function requestLiveStats(){if(!currentLogsShop||!ws||ws.readyState!==1)return;ws.send(JSON.stringify({type:'command.livestats',data:{shop:currentLogsShop,window:currentStatsWindow}}));} function renderLiveStats(data){if(!data.success||!data.stats)return;const st=data.stats;document.getElementById('topIpsList').innerHTML=renderTopIps(st.top_ips||[]);document.getElementById('suspiciousIpsList').innerHTML=renderSuspiciousIps(st.suspicious_ips||[]);document.getElementById('topRequestsList').innerHTML=renderRequests(st.top_requests||[]);document.getElementById('topBlockedList').innerHTML=renderRequests(st.top_blocked||[],'blocked');} - function renderTopIps(ips){if(!ips.length)return '
Keine Daten
';return ips.slice(0,10).map(ip=>'
'+ip.ip+''+getCountryName(ip.country)+' | '+(ip.org||ip.asn||'-')+'
'+ip.count+'x
').join('');} - function renderSuspiciousIps(ips){if(!ips.length)return '
Keine verdächtigen IPs
';return ips.slice(0,5).map(ip=>'
'+ip.ip+''+getCountryName(ip.country)+' | '+ip.reason+(ip.errors?' | '+ip.errors+' Errors':'')+'
'+ip.count+'x
').join('');} + function renderTopIps(ips){if(!ips.length)return '
Keine Daten
';return ips.slice(0,10).map(ip=>'
'+ip.ip+''+getCountryName(ip.country)+' | '+(ip.org||ip.asn||'-')+'
'+ip.count+'x
').join('');} + function renderSuspiciousIps(ips){if(!ips.length)return '
Keine verdächtigen IPs
';return ips.slice(0,5).map(ip=>'
'+ip.ip+''+getCountryName(ip.country)+' | '+ip.reason+(ip.errors?' | '+ip.errors+' Errors':'')+'
'+ip.count+'x
').join('');} function renderRequests(reqs,type){if(!reqs.length)return '
Keine Daten
';return reqs.slice(0,10).map(r=>'
'+r.path+''+r.count+'x
').join('');} function quickBan(ip){if(!currentLogsShop)return;const duration=prompt('Ban-Dauer auswählen:\\n\\n900 = 15 Minuten\\n3600 = 1 Stunde\\n21600 = 6 Stunden\\n86400 = 24 Stunden\\n604800 = 7 Tage\\n-1 = Permanent','3600');if(duration===null)return;ws.send(JSON.stringify({type:'command.ban',data:{shop:currentLogsShop,ip:ip,duration:parseInt(duration),reason:'Manual ban from dashboard'}}));toast('IP '+ip+' wird gebannt...','success');} function quickWhitelist(ip){if(!currentLogsShop)return;const desc=prompt('Beschreibung (optional):','');if(desc===null)return;ws.send(JSON.stringify({type:'command.whitelist',data:{shop:currentLogsShop,ip:ip,description:desc}}));toast('IP '+ip+' wird gewhitelisted...','success');}