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:
parent
4dd8884549
commit
fffe96999c
@ -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);
|
||||
},
|
||||
|
||||
|
||||
@ -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();
|
||||
},
|
||||
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user