mirror of https://github.com/wg-easy/wg-easy
13 changed files with 100 additions and 98 deletions
@ -0,0 +1,16 @@ |
|||||
|
<template> |
||||
|
<Toggle |
||||
|
v-model:pressed="globalStore.uiShowCharts" |
||||
|
class="group inline-flex h-8 w-8 cursor-pointer items-center justify-center whitespace-nowrap rounded-full bg-gray-200 transition hover:bg-gray-300 dark:bg-neutral-700 dark:hover:bg-neutral-600" |
||||
|
:title="$t('toggleCharts')" |
||||
|
@update:pressed="globalStore.toggleCharts" |
||||
|
> |
||||
|
<IconsChart |
||||
|
class="h-5 w-5 fill-gray-400 transition group-data-[state=on]:fill-gray-600 dark:fill-neutral-600 dark:group-data-[state=on]:fill-neutral-400" |
||||
|
/> |
||||
|
</Toggle> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
const globalStore = useGlobalStore(); |
||||
|
</script> |
@ -0,0 +1,11 @@ |
|||||
|
<template> |
||||
|
<NuxtLink to="/" class="mb-4 flex-grow self-start"> |
||||
|
<h1 class="text-4xl font-medium dark:text-neutral-200"> |
||||
|
<img |
||||
|
src="/logo.png" |
||||
|
width="32" |
||||
|
class="dark:bg mr-2 inline align-middle" |
||||
|
/><span class="align-middle">WireGuard</span> |
||||
|
</h1> |
||||
|
</NuxtLink> |
||||
|
</template> |
@ -0,0 +1,28 @@ |
|||||
|
<template> |
||||
|
<button |
||||
|
class="flex h-8 w-8 items-center justify-center rounded-full bg-gray-200 transition hover:bg-gray-300 dark:bg-neutral-700 dark:hover:bg-neutral-600" |
||||
|
:title="$t(`theme.${theme.preference}`)" |
||||
|
@click="toggleTheme" |
||||
|
> |
||||
|
<IconsSun v-if="theme.preference === 'light'" class="h-5 w-5" /> |
||||
|
<IconsMoon |
||||
|
v-else-if="theme.preference === 'dark'" |
||||
|
class="h-5 w-5 text-neutral-400" |
||||
|
/> |
||||
|
<IconsHalfMoon v-else class="h-5 w-5 fill-gray-600 dark:fill-neutral-400" /> |
||||
|
</button> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
const theme = useTheme(); |
||||
|
|
||||
|
function toggleTheme() { |
||||
|
const themeCycle = { |
||||
|
system: 'light', |
||||
|
light: 'dark', |
||||
|
dark: 'system', |
||||
|
} as const; |
||||
|
|
||||
|
theme.preference = themeCycle[theme.preference]; |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,27 @@ |
|||||
|
<template> |
||||
|
<div |
||||
|
v-if="globalStore.updateAvailable && globalStore.latestRelease" |
||||
|
class="font-small mb-10 rounded-md bg-red-800 p-4 text-sm text-white shadow-lg dark:bg-red-100 dark:text-red-600" |
||||
|
:title="`v${globalStore.currentRelease} → v${globalStore.latestRelease.version}`" |
||||
|
> |
||||
|
<div class="container mx-auto flex flex-auto flex-row items-center"> |
||||
|
<div class="flex-grow"> |
||||
|
<p class="font-bold">{{ $t('updateAvailable') }}</p> |
||||
|
<p>{{ globalStore.latestRelease.changelog }}</p> |
||||
|
</div> |
||||
|
|
||||
|
<a |
||||
|
:href="`https://github.com/wg-easy/wg-easy/releases/tag/${globalStore.latestRelease.version}`" |
||||
|
target="_blank" |
||||
|
class="font-sm float-right flex-shrink-0 rounded-md border-2 border-red-800 bg-white p-3 font-semibold text-red-800 transition-all hover:border-white hover:bg-red-800 hover:text-white dark:border-red-600 dark:bg-red-100 dark:text-red-600 dark:hover:border-red-600 dark:hover:bg-red-600 dark:hover:text-red-100" |
||||
|
> |
||||
|
{{ $t('update') }} → |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts" setup> |
||||
|
const globalStore = useGlobalStore(); |
||||
|
globalStore.fetchRelease(); |
||||
|
</script> |
Loading…
Reference in new issue