From bcc983f11f199c8ea7361677d54a9331ac568a9d Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Thu, 5 Sep 2024 16:43:46 +0800 Subject: [PATCH] Update presharedKeyInput.vue Added preshared key switch --- .../newPeersComponents/presharedKeyInput.vue | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) 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 = "" + } + } } }