0
0
mirror of https://github.com/vx3r/wg-gen-web.git synced 2024-12-18 00:13:23 +00:00

add tags to clients

This commit is contained in:
TheLD 2020-05-26 16:42:37 +02:00
parent 7e2146a229
commit ce7e90e034
2 changed files with 42 additions and 1 deletions

View File

@ -16,6 +16,7 @@ type Client struct {
PresharedKey string `json:"presharedKey"` PresharedKey string `json:"presharedKey"`
AllowedIPs []string `json:"allowedIPs"` AllowedIPs []string `json:"allowedIPs"`
Address []string `json:"address"` Address []string `json:"address"`
Tags []string `json:"tags"`
PrivateKey string `json:"privateKey"` PrivateKey string `json:"privateKey"`
PublicKey string `json:"publicKey"` PublicKey string `json:"publicKey"`
CreatedBy string `json:"createdBy"` CreatedBy string `json:"createdBy"`

View File

@ -255,7 +255,26 @@
</v-chip> </v-chip>
</template> </template>
</v-combobox> </v-combobox>

<v-combobox
v-model="client.tags"
chips
hint="Write tag name and hit enter"
label="Tags"
multiple
dark
>
<template v-slot:selection="{ attrs, item, select, selected }">
<v-chip
v-bind="attrs"
:input-value="selected"
close
@click="select"
@click:close="client.tags.splice(client.tags.indexOf(item), 1)"
>
<strong>{{ item }}</strong>&nbsp;
</v-chip>
</template>
</v-combobox>
<v-switch <v-switch
v-model="client.enable" v-model="client.enable"
color="red" color="red"
@ -360,6 +379,26 @@
</v-chip> </v-chip>
</template> </template>
</v-combobox> </v-combobox>
<v-combobox
v-model="client.tags"
chips
hint="Write tag name and hit enter"
label="Tags"
multiple
dark
>
<template v-slot:selection="{ attrs, item, select, selected }">
<v-chip
v-bind="attrs"
:input-value="selected"
close
@click="select"
@click:close="client.tags.splice(client.tags.indexOf(item), 1)"
>
<strong>{{ item }}</strong>&nbsp;
</v-chip>
</template>
</v-combobox>
<v-switch <v-switch
v-model="client.ignorePersistentKeepalive" v-model="client.ignorePersistentKeepalive"
color="red" color="red"
@ -451,6 +490,7 @@
enable: true, enable: true,
allowedIPs: this.server.allowedips, allowedIPs: this.server.allowedips,
address: this.server.address, address: this.server.address,
tags: [],
} }
this.dialogCreate = true; this.dialogCreate = true;
}, },