diff --git a/src/www/js/app.js b/src/www/js/app.js index e22cbfe0..2ff9e69e 100644 --- a/src/www/js/app.js +++ b/src/www/js/app.js @@ -36,10 +36,13 @@ new Vue({ clientDelete: null, clientCreate: null, clientCreateName: '', + clientCreateAllowedIps: '', clientEditName: null, clientEditNameId: null, clientEditAddress: null, clientEditAddressId: null, + clientEditAllowIPS: null, + clientEditAllowIPSId: null, qrcode: null, currentRelease: null, @@ -208,9 +211,10 @@ new Vue({ }, createClient() { const name = this.clientCreateName; + const allowedGWIPs = this.clientCreateAllowedIps; if (!name) return; - this.api.createClient({ name }) + this.api.createClient({ name, allowedGWIPs }) .catch(err => alert(err.message || err.toString())) .finally(() => this.refresh().catch(console.error)); }, @@ -239,6 +243,11 @@ new Vue({ .catch(err => alert(err.message || err.toString())) .finally(() => this.refresh().catch(console.error)); }, + updateClientAllowIPS(client, allowedGWIPs) { + this.api.updateClientAllowIPS({ clientId: client.id, allowedGWIPs }) + .catch(err => alert(err.message || err.toString())) + .finally(() => this.refresh().catch(console.error)); + }, }, filters: { bytes,