From e1d70c5bac7c6d9ae79019c1211e0055a1c75932 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 4 Feb 2026 17:00:46 +0100 Subject: [PATCH] fix(crowdsec-dashboard): Fix decisions list empty due to wrong RPC expect key The callDecisions RPC declaration used expect: { alerts: [] } but the backend returns { decisions: [...] }, causing the unwrapped result to always be empty. Also removed leftover console.log debug statements. Co-Authored-By: Claude Opus 4.5 --- .../luci-static/resources/crowdsec-dashboard/api.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/crowdsec-dashboard/api.js b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/crowdsec-dashboard/api.js index d3b598f6..ca631daa 100644 --- a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/crowdsec-dashboard/api.js +++ b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/crowdsec-dashboard/api.js @@ -20,7 +20,7 @@ var callStatus = rpc.declare({ var callDecisions = rpc.declare({ object: 'luci.crowdsec-dashboard', method: 'decisions', - expect: { alerts: [] } + expect: { decisions: [] } }); var callAlerts = rpc.declare({ @@ -387,14 +387,7 @@ function formatRelativeTime(dateStr) { return baseclass.extend({ getStatus: callStatus, - getDecisions: function() { - return callDecisions().then(function(result) { - console.log('[API] getDecisions raw result:', result); - console.log('[API] getDecisions result type:', typeof result); - console.log('[API] getDecisions is array:', Array.isArray(result)); - return result; - }); - }, + getDecisions: callDecisions, getAlerts: callAlerts, getBouncers: callBouncers, getMetrics: callMetrics,