mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-06-28 09:16:55 +00:00
Update peerQRCode.vue
This commit is contained in:
parent
1f73adffd6
commit
91b499fb14
@ -24,6 +24,7 @@ export default {
|
|||||||
}, (res) => {
|
}, (res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.status){
|
if (res.status){
|
||||||
|
let data = ""
|
||||||
if (this.selectedPeer.configuration.Protocol === "awg"){
|
if (this.selectedPeer.configuration.Protocol === "awg"){
|
||||||
let awgQRCodeObject = {
|
let awgQRCodeObject = {
|
||||||
containers: [
|
containers: [
|
||||||
@ -41,17 +42,13 @@ export default {
|
|||||||
description: this.selectedPeer.name,
|
description: this.selectedPeer.name,
|
||||||
hostName: this.dashboardStore.Configuration.Peers.remote_endpoint
|
hostName: this.dashboardStore.Configuration.Peers.remote_endpoint
|
||||||
}
|
}
|
||||||
|
data = JSON.stringify(awgQRCodeObject)
|
||||||
QRCode.toCanvas(document.querySelector("#qrcode"), btoa(JSON.stringify(awgQRCodeObject)), (error) => {
|
|
||||||
if (error) console.error(error)
|
|
||||||
})
|
|
||||||
}else{
|
}else{
|
||||||
QRCode.toCanvas(document.querySelector("#qrcode"), res.data.file, (error) => {
|
data = res.data.file
|
||||||
if (error) console.error(error)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
QRCode.toCanvas(document.querySelector("#qrcode"), data, (error) => {
|
||||||
|
if (error) console.error(error)
|
||||||
|
})
|
||||||
}else{
|
}else{
|
||||||
this.dashboardStore.newMessage("Server", res.message, "danger")
|
this.dashboardStore.newMessage("Server", res.message, "danger")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user