Browse Source

Update app.js

pull/400/head
wingsman2 4 years ago
committed by GitHub
parent
commit
9212b5244d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      src/www/js/app.js

11
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,

Loading…
Cancel
Save