From 1e7ae105f7ca45e9e704dd46455805a0e9e82815 Mon Sep 17 00:00:00 2001 From: Bernd Storath <999999bst@gmail.com> Date: Mon, 5 Aug 2024 15:10:11 +0200 Subject: [PATCH] fix styling issue, fix formatting --- .vscode/settings.json | 6 +++++- src/app.vue | 2 +- src/server/utils/WireGuard.ts | 14 ++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index a63fd15a..c966f5a5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,9 @@ "editor.tabSize": 2, "editor.useTabStops": false, "editor.defaultFormatter": "esbenp.prettier-vscode", - "editor.formatOnSave": true + "editor.formatOnSave": true, + "vue.format.enable": false, + "[vue]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, } \ No newline at end of file diff --git a/src/app.vue b/src/app.vue index 20b27691..5d365600 100644 --- a/src/app.vue +++ b/src/app.vue @@ -190,7 +190,7 @@ > { }); + await exec('wg-quick down wg0').catch(() => {}); await exec('wg-quick up wg0').catch((err) => { if ( err && @@ -130,8 +130,9 @@ PostDown = ${WG_POST_DOWN} # Client: ${client.name} (${clientId}) [Peer] PublicKey = ${client.publicKey} -${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' - }AllowedIPs = ${client.address}/32`; +${ + client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' +}AllowedIPs = ${client.address}/32`; } debug('Config saving...'); @@ -232,8 +233,9 @@ ${WG_MTU ? `MTU = ${WG_MTU}\n` : ''}\ [Peer] PublicKey = ${config.server.publicKey} -${client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' - }AllowedIPs = ${WG_ALLOWED_IPS} +${ + client.preSharedKey ? `PresharedKey = ${client.preSharedKey}\n` : '' +}AllowedIPs = ${WG_ALLOWED_IPS} PersistentKeepalive = ${WG_PERSISTENT_KEEPALIVE} Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; } @@ -383,7 +385,7 @@ Endpoint = ${WG_HOST}:${WG_CONFIG_PORT}`; // Shutdown wireguard async Shutdown() { - await exec('wg-quick down wg0').catch(() => { }); + await exec('wg-quick down wg0').catch(() => {}); } }