diff --git a/frontend/src/components/layout/Navbar.vue b/frontend/src/components/layout/Navbar.vue index c392670ee..7cef5e51d 100644 --- a/frontend/src/components/layout/Navbar.vue +++ b/frontend/src/components/layout/Navbar.vue @@ -13,7 +13,7 @@ - + - - - AN - - {{ authUser.first_name }} {{ authUser.last_name }} - + + + + + AN + + {{ authUser.first_name }} {{ authUser.last_name }} + mdi-chevron-up + + + + + + {{ item.icon }} + + + {{ item.text }} + + + + @@ -90,7 +110,7 @@ export default { data () { return { drawer: true, - items: [ + mainMenuItems: [ { text: this.$gettext('Dashboard'), icon: 'mdi-view-dashboard-outline' @@ -114,18 +134,32 @@ export default { text: this.$gettext('Parameters'), children: [] } + ], + userMenuItems: [ + { + text: this.$gettext('Logout'), + icon: 'mdi-logout', + click: this.logout + } ] } }, created () { this.$axios.get('/parameters/applications/').then(response => { response.data.forEach(item => { - this.items[4].children.push({ + this.mainMenuItems[4].children.push({ text: item.label, to: { name: 'ParametersEdit', params: { app: item.name } } }) }) }) + }, + methods: { + logout () { + this.$store.dispatch('auth/logout').then(() => { + this.$router.push('/login') + }) + } } }