Add admin layout and pages: implement sidebar navigation and user role checks
This commit is contained in:
1 parent
a9cb8c45d5
commit
0f76978a33
7 files changed
+121
No files matched your search
@@ -11,6 +11,8 @@ const onSearchInput = (v: string) => {
|
||||
else router.replace("/search")
|
||||
}, 300)
|
||||
}
|
||||
|
||||
const { data: user } = useApiFetch<any>("/user")
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -69,6 +71,20 @@ const onSearchInput = (v: string) => {
|
||||
Songs
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div v-if="user?.role == 'admin'" class="category">
|
||||
<p>Secret stuff</p>
|
||||
|
||||
<Button
|
||||
full
|
||||
variant="ghost"
|
||||
to="/admin"
|
||||
type="link"
|
||||
icon-name="lucide:settings-2"
|
||||
>
|
||||
Go To Admin Panel
|
||||
</Button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #default>
|
||||
|
||||
Reference in new issue
Block a user