-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Diogo Correia <me@diogotc.com>
- Loading branch information
1 parent
74283b3
commit ae46e3e
Showing
8 changed files
with
368 additions
and
120 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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,112 @@ | ||
<template> | ||
<div> | ||
<v-app-bar clipped-left app> | ||
<v-app-bar-nav-icon | ||
v-if="$vuetify.breakpoint.mdAndDown" | ||
color="primary" | ||
@click.stop="drawer = !drawer" | ||
></v-app-bar-nav-icon> | ||
<img :src="logoSrc" style="height: 100%" /> | ||
</v-app-bar> | ||
<v-navigation-drawer v-model="drawer" clipped :permanent="$vuetify.breakpoint.lgAndUp" app> | ||
<v-list nav> | ||
<v-list-item-group v-for="(route, index) in routes" :key="index" v-model="group"> | ||
<v-list-item | ||
v-if="getPermissionLevel >= (route.permission || 0)" | ||
:to="route.link" | ||
text | ||
color="primary" | ||
class="mb-1" | ||
> | ||
<v-icon v-if="route.icon" left> | ||
{{ route.icon }} | ||
</v-icon> | ||
{{ route.text }} | ||
</v-list-item> | ||
</v-list-item-group> | ||
</v-list> | ||
<template #append> | ||
<div class="pa-2"> | ||
<v-btn block color="primary" outlined @click="onLogout"> | ||
<v-icon left>mdi-logout</v-icon>Logout | ||
</v-btn> | ||
<div class="py-2 grey--text text--lighten-2 text-center"> | ||
Created with | ||
<v-icon color="primary">mdi-heart</v-icon> by <strong>Hackerschool</strong> <br /> | ||
<v-icon x-small>mdi-copyright</v-icon> | ||
{{ new Date().getFullYear() }} - v{{ version }} | ||
</div> | ||
</div> | ||
</template> | ||
</v-navigation-drawer> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapGetters, mapActions } from 'vuex'; | ||
import logoSrc from '@/assets/logo_navbar.png'; | ||
export default { | ||
data() { | ||
return { | ||
drawer: false, | ||
group: null, | ||
logoSrc, | ||
version: process.env.VUE_APP_VERSION, | ||
routes: [ | ||
{ | ||
text: 'Dashboard', | ||
icon: 'mdi-view-dashboard', | ||
link: '/', | ||
}, | ||
{ | ||
text: 'Requisitions', | ||
icon: 'mdi-format-list-bulleted-type', | ||
link: '/test', | ||
}, | ||
{ | ||
text: 'Locations', | ||
icon: 'mdi-map-marker', | ||
link: '/locations', | ||
permission: 1, // admin only | ||
}, | ||
{ | ||
text: 'Materials', | ||
icon: 'mdi-package-variant', | ||
link: '/materials', | ||
permission: 1, // admin only | ||
}, | ||
{ | ||
text: 'Members', | ||
icon: 'mdi-account-multiple', | ||
link: '/members', | ||
permission: 1, //admin only | ||
}, | ||
], | ||
}; | ||
}, | ||
computed: { | ||
title() { | ||
return this.$route.meta.title || 'Inventory'; | ||
}, | ||
...mapGetters('user', ['getPermissionLevel']), | ||
}, | ||
watch: { | ||
group() { | ||
this.drawer = true; | ||
}, | ||
}, | ||
methods: { | ||
onLogout: function () { | ||
localStorage.removeItem('token'); | ||
this.logoutUser(); | ||
this.$router.push('login'); | ||
}, | ||
...mapActions('user', ['logoutUser']), | ||
}, | ||
}; | ||
</script> |
Oops, something went wrong.