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 <noreply@anthropic.com>
This commit is contained in:
parent
2a4423d036
commit
14690ebe9e
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=luci-app-wireguard-dashboard
|
PKG_NAME:=luci-app-wireguard-dashboard
|
||||||
PKG_VERSION:=0.7.0
|
PKG_VERSION:=0.7.0
|
||||||
PKG_RELEASE:=4
|
PKG_RELEASE:=5
|
||||||
PKG_ARCH:=all
|
PKG_ARCH:=all
|
||||||
|
|
||||||
PKG_LICENSE:=Apache-2.0
|
PKG_LICENSE:=Apache-2.0
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
'require form';
|
'require form';
|
||||||
'require network';
|
'require network';
|
||||||
'require wireguard-dashboard/api as api';
|
'require wireguard-dashboard/api as api';
|
||||||
|
'require wireguard-dashboard/qrcode as qrcode';
|
||||||
|
|
||||||
// Zone presets for peer creation
|
// Zone presets for peer creation
|
||||||
var ZONE_PRESETS = {
|
var ZONE_PRESETS = {
|
||||||
@ -718,15 +719,12 @@ return view.extend({
|
|||||||
])
|
])
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Load QR library and generate
|
// Generate QR code using our library
|
||||||
if (typeof QRCode !== 'undefined') {
|
var svg = qrcode.generateSVG(config, 256);
|
||||||
new QRCode(qrContainer, {
|
if (svg) {
|
||||||
text: config,
|
qrContainer.innerHTML = svg;
|
||||||
width: 256,
|
|
||||||
height: 256
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
qrContainer.innerHTML = '<p>' + _('QR library not loaded') + '</p>';
|
qrContainer.innerHTML = '<p>' + _('QR generation failed - config too long') + '</p>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user