forked from mirrors/amnezia-wg-easy
allow edit of name + address
This commit is contained in:
parent
2966666cc6
commit
016382dd01
11 changed files with 221 additions and 205 deletions
|
@ -94,4 +94,20 @@ class API {
|
|||
});
|
||||
}
|
||||
|
||||
async updateClientName({ clientId, name }) {
|
||||
return this.call({
|
||||
method: 'put',
|
||||
path: `/wireguard/client/${clientId}/name/`,
|
||||
body: { name },
|
||||
});
|
||||
}
|
||||
|
||||
async updateClientAddress({ clientId, address }) {
|
||||
return this.call({
|
||||
method: 'put',
|
||||
path: `/wireguard/client/${clientId}/address/`,
|
||||
body: { address },
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,10 @@ new Vue({
|
|||
clientDelete: null,
|
||||
clientCreate: null,
|
||||
clientCreateName: '',
|
||||
clientEditName: null,
|
||||
clientEditNameId: null,
|
||||
clientEditAddress: null,
|
||||
clientEditAddressId: null,
|
||||
qrcode: null,
|
||||
},
|
||||
methods: {
|
||||
|
@ -101,6 +105,16 @@ new Vue({
|
|||
.catch(err => alert(err.message || err.toString()))
|
||||
.finally(() => this.refresh().catch(console.error));
|
||||
},
|
||||
updateClientName(client, name) {
|
||||
this.api.updateClientName({ clientId: client.id, name })
|
||||
.catch(err => alert(err.message || err.toString()))
|
||||
.finally(() => this.refresh().catch(console.error));
|
||||
},
|
||||
updateClientAddress(client, address) {
|
||||
this.api.updateClientAddress({ clientId: client.id, address })
|
||||
.catch(err => alert(err.message || err.toString()))
|
||||
.finally(() => this.refresh().catch(console.error));
|
||||
},
|
||||
},
|
||||
filters: {
|
||||
timeago: value => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue