From 14690ebe9ebc766a2c5d485f84a097442445ed8e Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Fri, 23 Jan 2026 12:42:16 +0100 Subject: [PATCH] fix(wireguard-dashboard): Use qrcode module in wizard.js The wizard.js was looking for a global QRCode object that doesn't exist. Updated to import and use our qrcode module like other views do. Co-Authored-By: Claude Opus 4.5 --- .../secubox/luci-app-wireguard-dashboard/Makefile | 2 +- .../resources/view/wireguard-dashboard/wizard.js | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/package/secubox/luci-app-wireguard-dashboard/Makefile b/package/secubox/luci-app-wireguard-dashboard/Makefile index ecb89292..218bd0d3 100644 --- a/package/secubox/luci-app-wireguard-dashboard/Makefile +++ b/package/secubox/luci-app-wireguard-dashboard/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-wireguard-dashboard PKG_VERSION:=0.7.0 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_ARCH:=all PKG_LICENSE:=Apache-2.0 diff --git a/package/secubox/luci-app-wireguard-dashboard/htdocs/luci-static/resources/view/wireguard-dashboard/wizard.js b/package/secubox/luci-app-wireguard-dashboard/htdocs/luci-static/resources/view/wireguard-dashboard/wizard.js index 78290484..1df57baa 100644 --- a/package/secubox/luci-app-wireguard-dashboard/htdocs/luci-static/resources/view/wireguard-dashboard/wizard.js +++ b/package/secubox/luci-app-wireguard-dashboard/htdocs/luci-static/resources/view/wireguard-dashboard/wizard.js @@ -5,6 +5,7 @@ 'require form'; 'require network'; 'require wireguard-dashboard/api as api'; +'require wireguard-dashboard/qrcode as qrcode'; // Zone presets for peer creation var ZONE_PRESETS = { @@ -718,15 +719,12 @@ return view.extend({ ]) ]); - // Load QR library and generate - if (typeof QRCode !== 'undefined') { - new QRCode(qrContainer, { - text: config, - width: 256, - height: 256 - }); + // Generate QR code using our library + var svg = qrcode.generateSVG(config, 256); + if (svg) { + qrContainer.innerHTML = svg; } else { - qrContainer.innerHTML = '

' + _('QR library not loaded') + '

'; + qrContainer.innerHTML = '

' + _('QR generation failed - config too long') + '

'; } },