diff --git a/src/static/app/src/components/configurationComponents/newPeersComponents/presharedKeyInput.vue b/src/static/app/src/components/configurationComponents/newPeersComponents/presharedKeyInput.vue index a8c7d56..25f8e85 100644 --- a/src/static/app/src/components/configurationComponents/newPeersComponents/presharedKeyInput.vue +++ b/src/static/app/src/components/configurationComponents/newPeersComponents/presharedKeyInput.vue @@ -4,17 +4,38 @@ export default { props: { data: Object, saving: Boolean + }, + data(){ + return{ + enable: false + } + }, + watch:{ + enable(){ + if (this.enable){ + this.data.preshared_key = window.wireguard.generateKeypair().presharedKey + }else { + this.data.preshared_key = "" + } + } } }