From dfedbe8be5d9710b7d7779261799bbe25962dbbe Mon Sep 17 00:00:00 2001 From: Thomas Ciesla Date: Thu, 8 Jan 2026 08:57:31 +0100 Subject: [PATCH] update dashboard --- jtl-wafi-dashboard.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jtl-wafi-dashboard.py b/jtl-wafi-dashboard.py index f6375f1..6830ac6 100644 --- a/jtl-wafi-dashboard.py +++ b/jtl-wafi-dashboard.py @@ -1456,12 +1456,13 @@ def get_dashboard_html() -> str: .btn-header { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; text-decoration: none; } .btn-header:hover { border-color: var(--accent); color: var(--accent); } main { padding: 24px; max-width: 1800px; margin: 0 auto; } - .stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 24px; } + .stats-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; margin-bottom: 24px; } .stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; } .stat-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; } .stat-value { font-size: 28px; font-weight: 700; } .stat-value.success { color: var(--success); } .stat-value.warning { color: var(--warning); } + .stat-value.danger { color: var(--danger); } .stat-value.link11 { color: var(--link11); } .stat-value.direct { color: var(--danger); } .top-shops-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 24px; } @@ -1584,9 +1585,10 @@ def get_dashboard_html() -> str:
Server Online
0
-
Shops Aktiv
0
+
Shops Aktiv
0/0
🛡️ Link11
0
⚡ Direkt
0
+
🚫 Bans
0
Human/min
0
Bot/min
0
@@ -1677,8 +1679,8 @@ def get_dashboard_html() -> str: function renderShops(){const all=Object.values(shops);let l11=all.filter(s=>s.link11),dir=all.filter(s=>!s.link11);l11=getSortedShops(l11,'link11');dir=getSortedShops(dir,'direct');document.getElementById('link11Count').textContent=l11.length+' Shops';document.getElementById('directCount').textContent=dir.length+' Shops';document.getElementById('shopsLink11Table').innerHTML=renderShopRows(l11);document.getElementById('shopsDirectTable').innerHTML=renderShopRows(dir);} function renderShopRows(l){return l.map(s=>{const modeStr=s.monitor_only?'🔍 Monitor':((s.bot_mode?'🤖':'')+(s.country_mode?' 🌍':''))||'-';const bansStr=s.monitor_only?'-':((s.stats?.active_bot_bans||0)+(s.stats?.active_country_bans||0));return ''+(s.status==='active'?'✅':'⭕')+''+s.domain+''+(s.agent_hostname||'-')+''+modeStr+''+((s.stats?.req_per_min||0).toFixed(1))+''+bansStr+''+formatRuntime(s.runtime_minutes)+'🔗'+(s.status==='active'?'':'')+'';}).join('');} function renderTopShops(){const l=Object.values(shops).filter(s=>s.status==='active').sort((a,b)=>(b.stats?.req_per_min||0)-(a.stats?.req_per_min||0)).slice(0,10);document.getElementById('topShopsList').innerHTML=l.map(s=>{const bans=(s.stats?.active_bot_bans||0)+(s.stats?.active_country_bans||0);return '
'+s.domain+'
'+((s.stats?.req_per_min||0).toFixed(1))+' req/m'+bans+' bans
';}).join('')||'
Keine aktiven Shops
';} - function updateStats(s){document.getElementById('statAgents').textContent=s.agents_online||0;document.getElementById('statShops').textContent=s.shops_active||0;document.getElementById('statLink11').textContent=s.shops_link11||0;document.getElementById('statDirect').textContent=s.shops_direct||0;document.getElementById('statHumanRpm').textContent=(s.human_rpm||0).toFixed(1);document.getElementById('statBotRpm').textContent=(s.bot_rpm||0).toFixed(1);} - function refreshStats(){const l=Object.values(shops),a=l.filter(s=>s.status==='active');document.getElementById('statShops').textContent=a.length;document.getElementById('statLink11').textContent=l.filter(s=>s.link11).length;document.getElementById('statDirect').textContent=l.filter(s=>!s.link11).length;document.getElementById('statHumanRpm').textContent=a.reduce((sum,s)=>sum+(s.stats?.human_rpm||0),0).toFixed(1);document.getElementById('statBotRpm').textContent=a.reduce((sum,s)=>sum+(s.stats?.bot_rpm||0),0).toFixed(1);} + function updateStats(s){document.getElementById('statAgents').textContent=s.agents_online||0;document.getElementById('statShops').textContent=(s.shops_active||0)+'/'+(s.shops_total||0);document.getElementById('statLink11').textContent=s.shops_link11||0;document.getElementById('statDirect').textContent=s.shops_direct||0;document.getElementById('statBans').textContent=s.active_bans||0;document.getElementById('statHumanRpm').textContent=(s.human_rpm||0).toFixed(1);document.getElementById('statBotRpm').textContent=(s.bot_rpm||0).toFixed(1);} + function refreshStats(){const l=Object.values(shops),a=l.filter(s=>s.status==='active');document.getElementById('statShops').textContent=a.length+'/'+l.length;document.getElementById('statLink11').textContent=l.filter(s=>s.link11).length;document.getElementById('statDirect').textContent=l.filter(s=>!s.link11).length;document.getElementById('statBans').textContent=l.reduce((sum,s)=>sum+(s.stats?.active_bot_bans||0)+(s.stats?.active_country_bans||0),0);document.getElementById('statHumanRpm').textContent=a.reduce((sum,s)=>sum+(s.stats?.human_rpm||0),0).toFixed(1);document.getElementById('statBotRpm').textContent=a.reduce((sum,s)=>sum+(s.stats?.bot_rpm||0),0).toFixed(1);} async function approveAgent(id){await fetch('/api/agents/'+id+'/approve',{method:'POST'});} function openActivateModal(d){document.getElementById('activateDomain').value=d;document.getElementById('activateDomainDisplay').value=d;document.getElementById('monitorOnlyCheck').checked=false;document.getElementById('botModeCheck').checked=true;document.getElementById('countryModeCheck').checked=false;toggleMonitorOnly();toggleBotOptions();toggleCountryOptions();document.getElementById('activateModal').classList.add('open');} function closeModal(id){document.getElementById(id).classList.remove('open');}