mirror of https://github.com/wg-easy/wg-easy
5 changed files with 53 additions and 27 deletions
@ -0,0 +1,42 @@ |
|||||
|
<template> |
||||
|
<main v-if="data"> |
||||
|
<FormGroup> |
||||
|
<FormHeading>Connection</FormHeading> |
||||
|
<FormTextField id="host" v-model="data.host" label="Host" /> |
||||
|
<FormNumberField id="port" v-model="data.port" label="Port" /> |
||||
|
</FormGroup> |
||||
|
<FormGroup> |
||||
|
<FormHeading>Allowed IPs</FormHeading> |
||||
|
<FormArrayField v-model="data.allowedIps" /> |
||||
|
</FormGroup> |
||||
|
<FormGroup> |
||||
|
<FormHeading>DNS</FormHeading> |
||||
|
<FormArrayField v-model="data.defaultDns" /> |
||||
|
</FormGroup> |
||||
|
<FormGroup> |
||||
|
<FormHeading>Advanced</FormHeading> |
||||
|
<FormNumberField id="mtu" v-model="data.mtu" label="MTU" /> |
||||
|
<FormNumberField |
||||
|
id="keepalive" |
||||
|
v-model="data.persistentKeepalive" |
||||
|
label="Persistent Keepalive" |
||||
|
/> |
||||
|
</FormGroup> |
||||
|
<FormGroup> |
||||
|
<FormHeading>Actions</FormHeading> |
||||
|
<FormActionField label="Revert!" @click="revert" /> |
||||
|
</FormGroup> |
||||
|
</main> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
const { data: _data, refresh } = await useFetch(`/api/admin/userconfig`, { |
||||
|
method: 'get', |
||||
|
}); |
||||
|
const data = toRef(_data.value); |
||||
|
|
||||
|
async function revert() { |
||||
|
await refresh(); |
||||
|
data.value = toRef(_data.value).value; |
||||
|
} |
||||
|
</script> |
@ -1,24 +0,0 @@ |
|||||
<template> |
|
||||
<div> |
|
||||
<FormGroup> |
|
||||
<FormHeading>Connection</FormHeading> |
|
||||
<FormTextField id="host" label="Host" /> |
|
||||
<FormTextField id="port" label="Port" /> |
|
||||
</FormGroup> |
|
||||
<FormGroup> |
|
||||
<FormHeading>Allowed IPs</FormHeading> |
|
||||
<FormArrayField /> |
|
||||
</FormGroup> |
|
||||
<FormGroup> |
|
||||
<FormHeading>DNS</FormHeading> |
|
||||
<FormArrayField /> |
|
||||
</FormGroup> |
|
||||
<FormGroup> |
|
||||
<FormHeading>Advanced</FormHeading> |
|
||||
<FormNumberField id="mtu" label="MTU" /> |
|
||||
<FormNumberField id="keepalive" label="Persistent Keepalive" /> |
|
||||
</FormGroup> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script setup lang="ts"></script> |
|
@ -0,0 +1,4 @@ |
|||||
|
export default defineEventHandler(async () => { |
||||
|
const system = await Database.system.get(); |
||||
|
return system.userConfig; |
||||
|
}); |
Loading…
Reference in new issue