0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2025-09-11 12:24:27 +00:00

Readme existing conf. Ui parse int

This commit is contained in:
vx3r
2020-01-31 11:27:30 +09:00
parent e6c562c51d
commit 28c3c405c7
2 changed files with 21 additions and 7 deletions

View File

@ -171,6 +171,7 @@
v-on="on"
color="success"
v-model="client.enable"
v-on:change="updateClient(client)"
/>
</template>
<span>Enable or disable this client</span>
@ -297,7 +298,7 @@
<v-btn
:disabled="!valid"
color="success"
@click="updateClient()"
@click="updateClient(clientToEdit)"
>
Submit
</v-btn>
@ -376,6 +377,9 @@
});
},
updateServer () {
// convert int values
this.server.listenPort = parseInt(this.server.listenPort, 10);
this.server.persistentKeepalive = parseInt(this.server.persistentKeepalive, 10);
this.$patch('/server', this.server).then((res) => {
this.notify('success', "Server successfully updated");
this.getData()
@ -414,9 +418,9 @@
return `${base}/client/${id}/config`
}
},
updateClient() {
updateClient(client) {
this.dialogEditClient = false;
this.$patch(`/client/${this.clientToEdit.id}`, this.clientToEdit).then((res) => {
this.$patch(`/client/${client.id}`, client).then((res) => {
this.notify('success', "Client successfully updated");
this.getData()
}).catch((e) => {