mirror of https://github.com/wg-easy/wg-easy
Browse Source
* start supporting ipv6 * add ipv6 support * build server with es2020 es2019 doesn't support bigint * fix issues, better namingpull/1618/head
committed by
Bernd Storath
22 changed files with 274 additions and 158 deletions
@ -1,60 +0,0 @@ |
|||||
<template> |
|
||||
<span class="group"> |
|
||||
<!-- Show --> |
|
||||
<input |
|
||||
v-show="clientEditAddressId === client.id" |
|
||||
ref="clientAddressInput" |
|
||||
v-model="clientEditAddress" |
|
||||
class="rounded border-2 dark:bg-neutral-700 border-gray-100 dark:border-neutral-600 focus:border-gray-200 dark:focus:border-neutral-500 outline-none w-20 text-black dark:text-neutral-300 dark:placeholder:text-neutral-500" |
|
||||
@keyup.enter=" |
|
||||
updateClientAddress(client, clientEditAddress); |
|
||||
clientEditAddress = null; |
|
||||
clientEditAddressId = null; |
|
||||
" |
|
||||
@keyup.escape=" |
|
||||
clientEditAddress = null; |
|
||||
clientEditAddressId = null; |
|
||||
" |
|
||||
/> |
|
||||
<span v-show="clientEditAddressId !== client.id" class="inline-block">{{ |
|
||||
client.address |
|
||||
}}</span> |
|
||||
|
|
||||
<!-- Edit --> |
|
||||
<span |
|
||||
v-show="clientEditAddressId !== client.id" |
|
||||
class="cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity" |
|
||||
@click=" |
|
||||
clientEditAddress = client.address; |
|
||||
clientEditAddressId = client.id; |
|
||||
nextTick(() => clientAddressInput?.select()); |
|
||||
" |
|
||||
> |
|
||||
<IconsEdit |
|
||||
class="h-4 w-4 inline align-middle opacity-25 hover:opacity-100" |
|
||||
/> |
|
||||
</span> |
|
||||
</span> |
|
||||
</template> |
|
||||
|
|
||||
<script setup lang="ts"> |
|
||||
defineProps<{ |
|
||||
client: LocalClient; |
|
||||
}>(); |
|
||||
|
|
||||
const clientsStore = useClientsStore(); |
|
||||
|
|
||||
const clientAddressInput = ref<HTMLInputElement | null>(null); |
|
||||
const clientEditAddress = ref<null | string>(null); |
|
||||
const clientEditAddressId = ref<null | string>(null); |
|
||||
|
|
||||
function updateClientAddress(client: WGClient, address: string | null) { |
|
||||
if (address === null) { |
|
||||
return; |
|
||||
} |
|
||||
api |
|
||||
.updateClientAddress({ clientId: client.id, address }) |
|
||||
.catch((err) => alert(err.message || err.toString())) |
|
||||
.finally(() => clientsStore.refresh().catch(console.error)); |
|
||||
} |
|
||||
</script> |
|
@ -0,0 +1,60 @@ |
|||||
|
<template> |
||||
|
<span class="group"> |
||||
|
<!-- Show --> |
||||
|
<input |
||||
|
v-show="clientEditAddress4Id === client.id" |
||||
|
ref="clientAddress4Input" |
||||
|
v-model="clientEditAddress4" |
||||
|
class="rounded border-2 dark:bg-neutral-700 border-gray-100 dark:border-neutral-600 focus:border-gray-200 dark:focus:border-neutral-500 outline-none w-20 text-black dark:text-neutral-300 dark:placeholder:text-neutral-500" |
||||
|
@keyup.enter=" |
||||
|
updateClientAddress4(client, clientEditAddress4); |
||||
|
clientEditAddress4 = null; |
||||
|
clientEditAddress4Id = null; |
||||
|
" |
||||
|
@keyup.escape=" |
||||
|
clientEditAddress4 = null; |
||||
|
clientEditAddress4Id = null; |
||||
|
" |
||||
|
/> |
||||
|
<span v-show="clientEditAddress4Id !== client.id" class="inline-block">{{ |
||||
|
client.address4 |
||||
|
}}</span> |
||||
|
|
||||
|
<!-- Edit --> |
||||
|
<span |
||||
|
v-show="clientEditAddress4Id !== client.id" |
||||
|
class="cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity" |
||||
|
@click=" |
||||
|
clientEditAddress4 = client.address4; |
||||
|
clientEditAddress4Id = client.id; |
||||
|
nextTick(() => clientAddress4Input?.select()); |
||||
|
" |
||||
|
> |
||||
|
<IconsEdit |
||||
|
class="h-4 w-4 inline align-middle opacity-25 hover:opacity-100" |
||||
|
/> |
||||
|
</span> |
||||
|
</span> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
defineProps<{ |
||||
|
client: LocalClient; |
||||
|
}>(); |
||||
|
|
||||
|
const clientsStore = useClientsStore(); |
||||
|
|
||||
|
const clientAddress4Input = ref<HTMLInputElement | null>(null); |
||||
|
const clientEditAddress4 = ref<null | string>(null); |
||||
|
const clientEditAddress4Id = ref<null | string>(null); |
||||
|
|
||||
|
function updateClientAddress4(client: WGClient, address4: string | null) { |
||||
|
if (address4 === null) { |
||||
|
return; |
||||
|
} |
||||
|
api |
||||
|
.updateClientAddress4({ clientId: client.id, address4 }) |
||||
|
.catch((err) => alert(err.message || err.toString())) |
||||
|
.finally(() => clientsStore.refresh().catch(console.error)); |
||||
|
} |
||||
|
</script> |
@ -1,8 +1,7 @@ |
|||||
export default defineEventHandler(async () => { |
export default defineEventHandler(async () => { |
||||
const system = await Database.getSystem(); |
|
||||
const latestRelease = await fetchLatestRelease(); |
const latestRelease = await fetchLatestRelease(); |
||||
return { |
return { |
||||
currentRelease: system.release, |
currentRelease: RELEASE, |
||||
latestRelease: latestRelease, |
latestRelease: latestRelease, |
||||
}; |
}; |
||||
}); |
}); |
||||
|
@ -1,5 +1,8 @@ |
|||||
import debug from 'debug'; |
import debug from 'debug'; |
||||
|
import packageJson from '@@/package.json'; |
||||
|
|
||||
export const WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; |
export const WG_PATH = process.env.WG_PATH || '/etc/wireguard/'; |
||||
|
|
||||
|
export const RELEASE = packageJson.release.version; |
||||
|
|
||||
export const SERVER_DEBUG = debug('Server'); |
export const SERVER_DEBUG = debug('Server'); |
||||
|
Loading…
Reference in new issue