frontend: Owner management
This commit is contained in:
parent
9df2ee08d2
commit
994ba0bc01
8 changed files with 293 additions and 27 deletions
|
|
@ -1,12 +1,34 @@
|
|||
<script setup>
|
||||
const { token, loadToken, logout } = useAuth()
|
||||
const router = useRouter()
|
||||
if (process.client) {
|
||||
loadToken()
|
||||
}
|
||||
function doLogout() {
|
||||
logout()
|
||||
router.push("/login")
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen bg-gray-100 text-gray-900">
|
||||
<header class="p-4 bg-white shadow">
|
||||
<div>
|
||||
<header class="p-4 bg-white shadow flex justify-between">
|
||||
<nav class="flex gap-4">
|
||||
<NuxtLink to="/">Dashboard</NuxtLink>
|
||||
<NuxtLink to="/owners">Owners</NuxtLink>
|
||||
<NuxtLink to="/servers">Servers</NuxtLink>
|
||||
<NuxtLink to="/workentries">Work Entries</NuxtLink>
|
||||
</nav>
|
||||
|
||||
<div>
|
||||
<button
|
||||
v-if="token"
|
||||
@click="doLogout"
|
||||
class="text-red-600 hover:underline"
|
||||
>
|
||||
Logout
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="p-6">
|
||||
|
|
@ -14,4 +36,3 @@
|
|||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue