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 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-02-04 17:00:46 +01:00
parent f561dda7a2
commit e1d70c5bac

View File

@ -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,