-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: added files for admin dashboard and Admin layout * feat: enahnced the code for restricting admin dashboard from normal users
- Loading branch information
1 parent
20d1a6a
commit b128c48
Showing
14 changed files
with
159 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<div class="bg-white m-20 w-[292px] h-[368px] p-8 text-base font-poppins shadow-[0_0_8px_#d8d5d5]"> | ||
<div class="w-[88%] flex items-center h-[36px] border-b border-[#e6e1e1]"> | ||
<img class="mr-3" src="assets/dashboard.svg" alt="dashboard"> | ||
Your Dashboard | ||
</div> | ||
<details class="my-5"> | ||
<summary class="flex cursor-pointer justify-between mt-6"> | ||
<div class="flex items-center"> | ||
<img class="mr-3" src="assets/box.svg" alt="box"> | ||
Products | ||
</div> | ||
<img src="assets/down.svg" alt="down" class="transition-transform ease-linear duration-400" id="down-arrow"> | ||
</summary > | ||
<ul class="list-none"> | ||
<li class="mt-5 ml-8 text-[#6C6C6C] cursor-pointer"><nuxt-link to="/manageProduct" exact-active-class="text-[#EA454C]">Product Management</nuxt-link></li> | ||
<li class="mt-5 ml-8 text-[#6C6C6C] cursor-pointer"><nuxt-link to="/addNewProduct" exact-active-class="text-[#EA454C]">Add New Product</nuxt-link></li> | ||
</ul> | ||
</details> | ||
<details class="my-5"> | ||
<summary class="flex cursor-pointer justify-between mt-6"> | ||
<div class="flex items-center"> | ||
<img class="mr-3" src="assets/calendar-check.svg" alt="box"> | ||
Events | ||
</div> | ||
<img src="assets/down.svg" alt="down" class="transition-transform ease-linear duration-400" id="down-arrow"> | ||
</summary> | ||
<ul class="list-none"> | ||
<li class="mt-5 ml-8 text-[#6C6C6C] cursor-pointer"><nuxt-link to="/manageEvent" exact-active-class="text-[#EA454C]">Events Management</nuxt-link></li> | ||
<li class="mt-5 ml-8 text-[#6C6C6C] cursor-pointer"><nuxt-link to="/addNewEvent" exact-active-class="text-[#EA454C]">Add New Event</nuxt-link></li> | ||
</ul> | ||
</details> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
details[open] summary #down-arrow{ | ||
transform: rotate(180deg); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<template> | ||
<link rel="icon" type="image/png" href="\favicon.png"> | ||
<div> | ||
<NavNew /> | ||
<div class="flex gap-5"> | ||
<Sidebar /> | ||
<slot /> | ||
</div> | ||
<Footer /> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineNuxtRouteMiddleware, navigateTo } from "nuxt/app"; | ||
import { useAuthStore } from "../store/auth"; | ||
|
||
export default defineNuxtRouteMiddleware((to,from)=>{ | ||
const authStore = useAuthStore(); | ||
if(!authStore.isAuthenticated){ | ||
return navigateTo("/404"); | ||
} | ||
else{ | ||
if(!authStore.is_Admin){ | ||
return navigateTo("/404"); | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
|
||
</template> | ||
|
||
<script> | ||
definePageMeta({ | ||
layout: 'admin-layout', | ||
middleware: 'admin-auth' | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
|
||
</template> | ||
|
||
<script > | ||
definePageMeta({ | ||
layout: 'admin-layout', | ||
middleware: 'admin-auth' | ||
}) | ||
</script> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
|
||
</template> | ||
|
||
<script > | ||
definePageMeta({ | ||
layout: 'admin-layout', | ||
middleware: 'admin-auth' | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<template> | ||
|
||
</template> | ||
|
||
<script > | ||
definePageMeta({ | ||
layout: 'admin-layout', | ||
middleware: 'admin-auth' | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters