From 91b499fb1495a3f450f6af45a323f7e27f6da779 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Sun, 4 May 2025 17:09:45 +0800 Subject: [PATCH] Update peerQRCode.vue --- .../configurationComponents/peerQRCode.vue | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/static/app/src/components/configurationComponents/peerQRCode.vue b/src/static/app/src/components/configurationComponents/peerQRCode.vue index 9ec48dc..8ca0260 100644 --- a/src/static/app/src/components/configurationComponents/peerQRCode.vue +++ b/src/static/app/src/components/configurationComponents/peerQRCode.vue @@ -24,6 +24,7 @@ export default { }, (res) => { this.loading = false; if (res.status){ + let data = "" if (this.selectedPeer.configuration.Protocol === "awg"){ let awgQRCodeObject = { containers: [ @@ -41,17 +42,13 @@ export default { description: this.selectedPeer.name, hostName: this.dashboardStore.Configuration.Peers.remote_endpoint } - - QRCode.toCanvas(document.querySelector("#qrcode"), btoa(JSON.stringify(awgQRCodeObject)), (error) => { - if (error) console.error(error) - }) + data = JSON.stringify(awgQRCodeObject) }else{ - QRCode.toCanvas(document.querySelector("#qrcode"), res.data.file, (error) => { - if (error) console.error(error) - }) + data = res.data.file } - - + QRCode.toCanvas(document.querySelector("#qrcode"), data, (error) => { + if (error) console.error(error) + }) }else{ this.dashboardStore.newMessage("Server", res.message, "danger") }