mirror of
https://github.com/CyberMind-FR/secubox-deb.git
synced 2026-07-28 21:17:36 +00:00
fix(portal): bind Active bans to /crowdsec/decisions count (2.2.2)
Some checks are pending
License Headers / check (push) Waiting to run
Some checks are pending
License Headers / check (push) Waiting to run
This commit is contained in:
parent
5e4c0d2dac
commit
877fb9e19a
|
|
@ -1,3 +1,11 @@
|
|||
secubox-portal (2.2.2-1~bookworm1) bookworm; urgency=medium
|
||||
|
||||
* fix(ui): 'Active bans' now reflects the live /crowdsec/decisions list
|
||||
(includes CAPI community blocklist) instead of the local-only
|
||||
health/summary.active_decisions; hero 'Bans active' kept consistent.
|
||||
|
||||
-- Gerald KERMA <devel@cybermind.fr> Mon, 29 Jun 2026 21:00:00 +0200
|
||||
|
||||
secubox-portal (2.2.1-1~bookworm1) bookworm; urgency=medium
|
||||
|
||||
* fix(ui): reskin the portal to the standard SecuBox template — shared
|
||||
|
|
|
|||
|
|
@ -355,7 +355,12 @@
|
|||
}
|
||||
|
||||
function renderBans(h, decisions) {
|
||||
const ban = h && h.crowdsec && h.crowdsec.active_decisions;
|
||||
// Prefer the live /crowdsec/decisions list (includes CAPI community
|
||||
// blocklist), falling back to health/summary's local-only count.
|
||||
const decList = decisions && Array.isArray(decisions.decisions) ? decisions.decisions
|
||||
: (Array.isArray(decisions) ? decisions : null);
|
||||
const ban = decList ? decList.filter(d => (d.type || 'ban') === 'ban').length
|
||||
: (h && h.crowdsec ? h.crowdsec.active_decisions : null);
|
||||
const alerts = h && h.crowdsec && h.crowdsec.alerts_today;
|
||||
const wafPct = h && h.waf && h.waf.blocked_pct;
|
||||
const wafCls = wafPct == null ? '' : (wafPct >= 25 ? 'crit' : wafPct >= 10 ? 'warn' : 'ok');
|
||||
|
|
@ -365,6 +370,8 @@
|
|||
$('t-waf').textContent = wafPct != null ? wafPct + '%' : '—';
|
||||
$('t-waf').className = 'v ' + wafCls;
|
||||
$('t-alerts').textContent = alerts != null ? alerts : '—';
|
||||
// Keep the hero "Bans active" consistent with the real blocked-IP count.
|
||||
if (ban != null && $('hero-bans')) $('hero-bans').textContent = ban;
|
||||
}
|
||||
|
||||
function renderVhosts(d) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user