fix(luci-app-crowdsec-dashboard): Fix API instantiation error

Changed 'new api()' to 'api' in all dashboard views since the API module
exports an object, not a constructor class.

Fixed files:
- overview.js
- decisions.js
- alerts.js
- metrics.js
- waf.js

This resolves the 'TypeError: api is not a constructor' error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-06 15:56:33 +01:00
parent 4dd8884549
commit fffe96999c
5 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@ return view.extend({
cssLink.href = L.resource('crowdsec-dashboard/dashboard.css');
document.head.appendChild(cssLink);
this.csApi = new api();
this.csApi = api;
return this.csApi.getAlerts(this.limit);
},

View File

@ -28,7 +28,7 @@ return view.extend({
cssLink.href = L.resource('crowdsec-dashboard/dashboard.css');
document.head.appendChild(cssLink);
this.csApi = new api();
this.csApi = api;
return this.csApi.getDecisions();
},

View File

@ -27,7 +27,7 @@ return view.extend({
cssLink.href = L.resource('crowdsec-dashboard/dashboard.css');
document.head.appendChild(cssLink);
this.csApi = new api();
this.csApi = api;
return Promise.all([
this.csApi.getMetrics(),

View File

@ -27,7 +27,7 @@ return view.extend({
document.head.appendChild(cssLink);
// Load API
this.csApi = new api();
this.csApi = api;
return Promise.all([
this.csApi.getDashboardData(),

View File

@ -24,7 +24,7 @@ return view.extend({
cssLink.href = L.resource('crowdsec-dashboard/dashboard.css');
document.head.appendChild(cssLink);
this.csApi = new api();
this.csApi = api;
return this.csApi.getWAFStatus().then(function(result) {
return {