From e47ff793f5cc68dde7769331956cc5272be52f8a Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Tue, 13 Jan 2026 11:54:16 +0100 Subject: [PATCH] fix(crowdsec-wizard): Don't abort XHR during acquisition config - Treat XHR abort as success when CrowdSec restarts after acquisition config - Auto-advance to Step 5 after brief delay - Bump to 0.7.0-r21 Co-Authored-By: Claude Opus 4.5 --- .../luci-app-crowdsec-dashboard/Makefile | 2 +- .../resources/view/crowdsec-dashboard/wizard.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/package/secubox/luci-app-crowdsec-dashboard/Makefile b/package/secubox/luci-app-crowdsec-dashboard/Makefile index d15656ef..9d0181a8 100644 --- a/package/secubox/luci-app-crowdsec-dashboard/Makefile +++ b/package/secubox/luci-app-crowdsec-dashboard/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-crowdsec-dashboard PKG_VERSION:=0.7.0 -PKG_RELEASE:=20 +PKG_RELEASE:=21 PKG_ARCH:=all PKG_LICENSE:=Apache-2.0 diff --git a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js index f0c081f2..fad790c6 100644 --- a/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js +++ b/package/secubox/luci-app-crowdsec-dashboard/htdocs/luci-static/resources/view/crowdsec-dashboard/wizard.js @@ -1141,10 +1141,21 @@ return view.extend({ } }, this)) .catch(L.bind(function(err) { - console.error('[Wizard] Acquisition configuration error:', err); + console.log('[Wizard] Acquisition configuration catch:', err); this.wizardData.acquisitionConfiguring = false; - ui.addNotification(null, E('p', _('Configuration failed: ') + err.message), 'error'); - this.refreshView(); + + // XHR abort during CrowdSec restart is expected - treat as success + if (err && err.message && err.message.indexOf('abort') !== -1) { + console.log('[Wizard] XHR aborted (CrowdSec restart) - treating as success'); + this.wizardData.acquisitionConfigured = true; + ui.addNotification(null, E('p', _('Log acquisition configured (service restarted)')), 'info'); + // Auto-advance to Step 5 after brief delay + setTimeout(L.bind(function() { this.goToStep(5); }, this), 1500); + } else { + console.error('[Wizard] Acquisition configuration error:', err); + ui.addNotification(null, E('p', _('Configuration failed: ') + err.message), 'error'); + this.refreshView(); + } }, this)); },