marketingPortal/pages/dashboard.vue

128 lines
2.6 KiB
Vue
Raw Normal View History

2025-02-16 13:10:19 +01:00
<template>
<v-app full-height>
<v-navigation-drawer>
<v-img src="/logo.jpg" height="75" class="my-6" />
<v-list color="primary" lines="two">
<v-list-item
2025-03-14 01:10:03 +01:00
v-for="(item, index) in menu"
:key="index"
:to="item.to"
:title="item.title"
:prepend-icon="item.icon"
2025-02-16 13:10:19 +01:00
/>
</v-list>
<template #append>
<v-list lines="two">
<v-list-item
@click="logOut"
title="Log out"
prepend-icon="mdi-logout"
base-color="error"
/>
</v-list>
</template>
</v-navigation-drawer>
<v-app-bar v-if="mdAndDown" elevation="2">
<template #prepend>
<v-img src="/logo.jpg" width="75" class="ml-3" />
</template>
<template #append>
<v-btn
@click="logOut"
class="mr-3"
variant="tonal"
color="error"
icon="mdi-logout"
/>
</template>
</v-app-bar>
<v-main>
<router-view />
<v-bottom-navigation :active="mdAndDown" color="primary" elevation="2">
2025-03-14 01:10:03 +01:00
<v-btn v-for="(item, index) in menu" :key="index" :to="item.to">
<v-icon :icon="item.icon" />
<span v-text="item.title" />
2025-02-16 13:10:19 +01:00
</v-btn>
</v-bottom-navigation>
</v-main>
</v-app>
</template>
<script setup>
definePageMeta({
middleware: ["authentication"],
layout: false,
});
const { mdAndDown } = useDisplay();
const { logout } = useDirectusAuth();
2025-03-14 01:10:03 +01:00
const tags = usePortalTags();
const interestMenu = [
2025-03-31 03:24:02 +02:00
{
to: "/dashboard/interest-eoi-queue",
icon: "mdi-tray-full",
title: "EOI Queue",
},
2025-03-14 01:10:03 +01:00
{
to: "/dashboard/interest-analytics",
icon: "mdi-view-dashboard",
title: "Analytics",
},
{
to: "/dashboard/interest-berth-list",
icon: "mdi-table",
title: "Berth List",
},
{
to: "/dashboard/interest-berth-status",
icon: "mdi-sail-boat",
title: "Berth Status",
},
{
to: "/dashboard/interest-list",
icon: "mdi-view-list",
title: "Interest List",
},
{
to: "/dashboard/interest-status",
icon: "mdi-account-check",
title: "Interest Status",
},
2025-03-31 03:30:20 +02:00
{
to: "/dashboard/interest-emails",
icon: "mdi-email",
title: "Emails",
},
2025-03-14 01:10:03 +01:00
];
const defaultMenu = [
{
to: "/dashboard/site",
icon: "mdi-view-dashboard",
title: "Site Analytics",
},
{
to: "/dashboard/data",
icon: "mdi-finance",
title: "Data Analytics",
},
];
const menu = computed(() =>
toValue(tags).interest ? interestMenu : defaultMenu
);
2025-02-16 13:10:19 +01:00
const logOut = async () => {
await logout();
return navigateTo("/login");
};
</script>