Add page and user monitoring in admin. Add permission editing in administration.

This commit is contained in:
2024-11-28 17:18:35 +01:00
parent 5062d52667
commit 429f1d4b38
13 changed files with 416 additions and 50 deletions

View File

@@ -18,17 +18,7 @@
</div>
</Tooltip>
<Tooltip v-else :message="'Mon profil'" side="right">
<DropdownMenu :options="[{
type: 'item',
label: 'Mon profil',
icon: 'radix-icons:avatar',
select: () => useRouter().push({ name: 'user-profile' }),
}, {
type: 'item',
label: 'Deconnexion',
icon: 'radix-icons:close',
select: () => clear(),
}]" side="right" align="start">
<DropdownMenu :options="options" side="bottom" align="end">
<div class="hover:border-opacity-70 flex">
<Icon :icon="'radix-icons:avatar'" class="w-7 h-7 p-1" />
</div>
@@ -55,15 +45,7 @@
</NuxtLink>
</Tooltip>
<Tooltip v-else :message="'Mon profil'" side="right">
<DropdownMenu :options="[{
type: 'item',
label: 'Mon profil',
select: () => useRouter().push({ name: 'user-profile' }),
}, {
type: 'item',
label: 'Deconnexion',
select: () => clear(),
}]" side="right" align="start">
<DropdownMenu :options="options" 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>
@@ -104,9 +86,20 @@
import { Icon } from '@iconify/vue/dist/iconify.js';
import type { NavigationTreeItem } from '~/server/api/navigation.get';
import { iconByType } from '#shared/general.utils';
import type { DropdownOption } from '~/components/base/DropdownMenu.vue';
const options = ref<DropdownOption[]>([{
type: 'item',
label: 'Mon profil',
select: () => useRouter().push({ name: 'user-profile' }),
}, {
type: 'item',
label: 'Deconnexion',
select: () => clear(),
}]);
const open = ref(false);
const { loggedIn, clear } = useUserSession();
const { loggedIn, user, clear } = useUserSession();
const route = useRouter().currentRoute;
const path = computed(() => route.value.params.path ? Array.isArray(route.value.params.path) ? route.value.params.path[0] : route.value.params.path : undefined);