From 6f01f28026d0e2d014f67db39c1f54162aeddb86 Mon Sep 17 00:00:00 2001 From: Bernd Storath <999999bst@gmail.com> Date: Sun, 21 Jul 2024 11:42:15 +0200 Subject: [PATCH] add missing ui functions --- src/www/js/api.js | 8 ++++++++ src/www/js/app.js | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/src/www/js/api.js b/src/www/js/api.js index 9006f5ab..239d7e1c 100644 --- a/src/www/js/api.js +++ b/src/www/js/api.js @@ -138,6 +138,14 @@ class API { }); } + async updateClientAddress6({ clientId, address6 }) { + return this.call({ + method: 'put', + path: `/wireguard/client/${clientId}/address6/`, + body: { address6 }, + }); + } + async restoreConfiguration(file) { return this.call({ method: 'put', diff --git a/src/www/js/app.js b/src/www/js/app.js index 60be75c3..fe3551c9 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -301,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)); + }, restoreConfig(e) { e.preventDefault(); const file = e.currentTarget.files.item(0);