-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.vue
More file actions
41 lines (35 loc) · 1.69 KB
/
app.vue
File metadata and controls
41 lines (35 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<template lang="pug">
.h-svh
.relative.text-theme-primary.flex.gap-12.px-8.py-4
img(src='~/assets/logo.png' width='150')
//.absolute.top-0.right-0.rounded-bl-3xl.flex.bg-gray-300.py-3.px-4
a.text-black.no-underline.cursor-pointer(@click="navigateTo('/addUser')") My Account
img.h-6.w-6(src='~/assets/account.png')
.flex.flex-col.gap-2
.text-theme-primary.font-bold.text-3xl Contact Database
.flex.gap-6
NavLink(class="hover:bg-blue-600 rounded-lg hover:text-white p-2" to='/') Search Page
NavLink(class="hover:bg-blue-600 rounded-lg hover:text-white p-2" v-if='isEditor || isAdmin' to='/editContact/?id=0') Add New Contact
NavLink(class="hover:bg-blue-600 rounded-lg hover:text-white p-2" v-if='isAdmin' to='/admin') Admin Page
NavLink(class="hover:bg-blue-600 rounded-lg hover:text-white p-2" v-if='isAdmin' to='/manageTags') Manage Tags
a.no-underline(href='/api/logout' class="hover:bg-blue-600 rounded-lg hover:text-white p-2") Logout
NuxtPage.h-full.px-8
</template>
<script setup lang="ts">
const runtime = useRuntimeConfig();
const router = useRouter();
const routes = ref(router.getRoutes());
const route = useRoute();
const cvCookie = useCookie('cvtoken');
const cvuser = useCookie('cvuser');
const isSearch = computed(() => route.path == "/Search/");
if (!cvCookie.value) {
await navigateTo('/api/login');
}
const id_info = computed(() => cvuser.value?.id);
const id = id_info.value as number;
const isViewer = computed(() => cvuser.value?.permission == "VIEWER");
const isEditor = computed(() => cvuser.value?.permission == "EDITOR");
const isAdmin = computed(() => cvuser.value?.permission == "ADMIN");
</script>
<style></style>