Finish Dropdown menu and start project config page

This commit is contained in:
2024-11-14 17:32:13 +01:00
parent 0c17dbf7bc
commit d708e9ceb6
15 changed files with 71 additions and 49 deletions

View File

@@ -19,17 +19,16 @@
</Tooltip>
<Tooltip v-else :message="'Mon profil'" side="right">
<DropdownMenu :options="[{
type: 'group',
items: [{
type: 'item',
label: 'Mon profil',
click: () => useRouter().push({ name: 'user-profile' }),
icon: 'radix-icons:avatar',
select: () => useRouter().push({ name: 'user-profile' }),
}, {
type: 'item',
label: 'Deconnexion',
click: () => clear(),
}]
}]">
icon: 'radix-icons:close',
select: () => clear(),
}]" side="right" align="start">
<div class="hover:border-opacity-70 flex">
<Icon :icon="'radix-icons:avatar'" class="w-7 h-7 p-1" />
</div>
@@ -57,17 +56,14 @@
</Tooltip>
<Tooltip v-else :message="'Mon profil'" side="right">
<DropdownMenu :options="[{
type: 'group',
items: [{
type: 'item',
label: 'Mon profil',
click: () => useRouter().push({ name: 'user-profile' }),
select: () => useRouter().push({ name: 'user-profile' }),
}, {
type: 'item',
label: 'Deconnexion',
click: () => clear(),
}]
}]">
select: () => clear(),
}]" side="right" align="start">
<div class="bg-light-20 dark:bg-dark-20 hover:border-opacity-70 flex border p-px border-light-50 dark:border-dark-50">
<Icon :icon="'radix-icons:avatar'" class="w-7 h-7 p-1" />
</div>
@@ -95,6 +91,7 @@
<script setup lang="ts">
import { Icon } from '@iconify/vue/dist/iconify.js';
import type { NavigationTreeItem } from '~/server/api/navigation.get';
const open = ref(false);
const { loggedIn, clear } = useUserSession();
@@ -111,8 +108,8 @@ const { data: pages } = await useLazyFetch('/api/navigation', {
watch: [useRouter().currentRoute]
});
function transform(list: any[]): any[]
function transform(list: NavigationTreeItem[]): any[]
{
return list?.map(e => ({ label: e.title, children: transform(e.children), link: e.path, tag: e.private ? 'private' : e.type, open: path.value?.startsWith(e.path)}))
return list?.map(e => ({ label: e.title, children: transform(e?.children ?? []), link: e.path, tag: e.private ? 'private' : e.type, open: path.value?.startsWith(e.path)}))
}
</script>