2022-03-24 15:49:33 +00:00
|
|
|
<script setup>
|
2022-04-20 14:23:03 +00:00
|
|
|
import { useI18n } from 'vue-i18n';
|
2022-03-24 15:49:33 +00:00
|
|
|
import { useState } from 'src/composables/useState';
|
|
|
|
import { useSession } from 'src/composables/useSession';
|
|
|
|
import UserPanel from 'src/components/UserPanel.vue';
|
|
|
|
|
2022-04-20 14:23:03 +00:00
|
|
|
const { t } = useI18n();
|
2022-03-24 15:49:33 +00:00
|
|
|
const session = useSession();
|
|
|
|
const state = useState();
|
|
|
|
const user = state.getUser();
|
|
|
|
const token = session.getToken();
|
|
|
|
|
2022-04-19 11:50:54 +00:00
|
|
|
function onToggleDrawer() {
|
|
|
|
state.drawer.value = !state.drawer.value;
|
|
|
|
}
|
2022-03-24 15:49:33 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<q-header class="bg-dark" color="white" elevated bordered>
|
|
|
|
<q-toolbar class="q-py-sm q-px-md">
|
2022-04-20 14:23:03 +00:00
|
|
|
<q-btn flat @click="onToggleDrawer()" round dense icon="menu">
|
|
|
|
<q-tooltip bottom anchor="bottom right">
|
|
|
|
{{ t('globals.collapseMenu') }}
|
|
|
|
</q-tooltip>
|
|
|
|
</q-btn>
|
2022-03-24 15:49:33 +00:00
|
|
|
<router-link to="/">
|
|
|
|
<q-btn flat round class="q-ml-xs" v-if="$q.screen.gt.xs">
|
|
|
|
<q-avatar square size="md">
|
|
|
|
<q-img src="~/assets/logo_icon.svg" alt="Logo" />
|
|
|
|
</q-avatar>
|
2022-04-20 14:23:03 +00:00
|
|
|
<q-tooltip bottom>
|
|
|
|
{{ t('globals.backToDashboard') }}
|
|
|
|
</q-tooltip>
|
2022-03-24 15:49:33 +00:00
|
|
|
</q-btn>
|
|
|
|
</router-link>
|
|
|
|
<q-toolbar-title shrink class="text-weight-bold">Salix</q-toolbar-title>
|
|
|
|
<q-space></q-space>
|
|
|
|
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
|
|
|
|
<q-btn v-if="$q.screen.gt.xs" dense flat size="md" icon="add">
|
|
|
|
<q-icon name="arrow_drop_down" size="s" />
|
|
|
|
<q-menu>
|
|
|
|
<q-list style="min-width: 150px">
|
2022-04-05 14:30:53 +00:00
|
|
|
<q-item :to="{ path: '/customer/create' }" clickable>
|
2022-03-24 15:49:33 +00:00
|
|
|
<q-item-section>New customer</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
<q-item clickable>
|
|
|
|
<q-item-section>New ticket</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
</q-list>
|
|
|
|
</q-menu>
|
|
|
|
</q-btn>
|
2022-04-20 14:23:03 +00:00
|
|
|
<q-btn v-if="$q.screen.gt.xs" dense flat round size="md" icon="notifications">
|
2022-05-17 12:58:01 +00:00
|
|
|
<q-badge color="red" text-color="white" floating> 2 </q-badge>
|
2022-04-20 14:23:03 +00:00
|
|
|
<q-tooltip bottom>
|
|
|
|
{{ t('globals.notifications') }}
|
|
|
|
</q-tooltip>
|
2022-05-17 12:58:01 +00:00
|
|
|
<q-menu class="q-pa-md" style="min-width: 250px">
|
|
|
|
<strong>Notifications</strong>
|
|
|
|
<q-separator />
|
|
|
|
<div style="text-align: center; font-size: 2em">
|
|
|
|
<q-spinner-puff color="orange" />
|
|
|
|
</div>
|
|
|
|
</q-menu>
|
2022-04-20 14:23:03 +00:00
|
|
|
</q-btn>
|
2022-05-23 13:46:09 +00:00
|
|
|
<q-btn dense flat no-wrap id="user">
|
2022-03-24 15:49:33 +00:00
|
|
|
<q-avatar size="lg">
|
|
|
|
<q-img
|
|
|
|
:src="`/api/Images/user/160x160/${user.id}/download?access_token=${token}`"
|
|
|
|
spinner-color="white"
|
2022-04-20 14:23:03 +00:00
|
|
|
>
|
|
|
|
</q-img>
|
2022-03-24 15:49:33 +00:00
|
|
|
</q-avatar>
|
|
|
|
<q-icon name="arrow_drop_down" size="s" />
|
2022-04-20 14:23:03 +00:00
|
|
|
<q-tooltip bottom>
|
|
|
|
{{ t('globals.userPanel') }}
|
|
|
|
</q-tooltip>
|
2022-03-24 15:49:33 +00:00
|
|
|
<UserPanel />
|
|
|
|
</q-btn>
|
|
|
|
</div>
|
|
|
|
</q-toolbar>
|
|
|
|
</q-header>
|
|
|
|
</template>
|