Newer
Older
<div id="app" :key="locale" class="tw-flex tw-flex-col tw-min-h-screen">
<div v-if="user.steeringUser !== null" class="tw-flex-1 tw-flex tw-my-8">
<router-view :modules="modules" :user="user" />
</div>

Richard Blechinger
committed
<div v-else class="tw-flex-1 tw-flex tw-my-8">
<home :modules="modules" :user="user" />
</div>
<script setup>
import AppHeader from './components/Header.vue'
import AppFooter from './components/Footer.vue'
import { useStore } from 'vuex'
import { useI18n } from '@/i18n'
import { computed } from 'vue'
const store = useStore()
const { locale, t } = useI18n()
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
const user = computed(() => store.state.auth.user)
const modules = computed(() => {
if ((user.value?.logged_in ?? false) === false) return {}
else if (user.value.steeringUser && user.value.steeringUser.is_superuser) {
return {
main: [
{
icon: '/assets/shows.svg',
slug: 'shows',
title: t('navigation.shows'),
},
{
icon: '/assets/files.svg',
slug: 'files',
title: t('navigation.filesPlaylists'),
},
{
icon: '/assets/calendar.svg',
slug: 'calendar',
title: t('navigation.calendar'),
},
],
footer: [
{
slug: 'settings',
title: t('navigation.settings'),
},
],
}
} else {
return {
main: [
{
icon: '/assets/shows.svg',
slug: 'shows',
title: t('navigation.shows'),
},
{
icon: '/assets/files.svg',
slug: 'files',
title: t('navigation.filesPlaylists'),
},
],
footer: [],
}
}
})
store.dispatch('auth/oidcInit')