From 047c53621072c2ef6c1167b04ef62f7576da9dec Mon Sep 17 00:00:00 2001 From: Bernd Storath <999999bst@gmail.com> Date: Sat, 15 Jun 2024 12:54:05 +0200 Subject: [PATCH] Update frontend Co-authored-by: Peter Lewis Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com> --- src/www/index.html | 25 +++++++++++++++++++++++++ src/www/js/api.js | 8 ++++++++ src/www/js/app.js | 7 +++++++ 3 files changed, 40 insertions(+) diff --git a/src/www/index.html b/src/www/index.html index 72044728..cbe8b4ff 100644 --- a/src/www/index.html +++ b/src/www/index.html @@ -226,6 +226,31 @@
+ + + + + + {{client.address6}} + + + + + + + + +
diff --git a/src/www/js/api.js b/src/www/js/api.js index 356164c5..27796f92 100644 --- a/src/www/js/api.js +++ b/src/www/js/api.js @@ -138,4 +138,12 @@ class API { }); } + async updateClientAddress6({ clientId, address6 }) { + return this.call({ + method: 'put', + path: `/wireguard/client/${clientId}/address6/`, + body: { address6 }, + }); + } + } diff --git a/src/www/js/app.js b/src/www/js/app.js index 6745f698..025f1a57 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -63,6 +63,8 @@ new Vue({ clientEditNameId: null, clientEditAddress: null, clientEditAddressId: null, + clientEditAddress6: null, + clientEditAddress6Id: null, qrcode: null, currentRelease: null, @@ -299,6 +301,11 @@ new Vue({ .catch((err) => alert(err.message || err.toString())) .finally(() => this.refresh().catch(console.error)); }, + updateClientAddress6(client, address6) { + this.api.updateClientAddress6({ clientId: client.id, address6 }) + .catch((err) => alert(err.message || err.toString())) + .finally(() => this.refresh().catch(console.error)); + }, toggleTheme() { const themes = ['light', 'dark', 'auto']; const currentIndex = themes.indexOf(this.uiTheme);