2021-10-23 03:08:02 +02:00
|
|
|
<template>
|
2022-05-11 23:27:40 +02:00
|
|
|
<div id="page-wrapper" class="page p-2 md:p-6 overflow-y-auto relative" :class="streamLibraryItem ? 'streaming' : ''">
|
2021-11-04 23:35:59 +01:00
|
|
|
<app-config-side-nav :is-open.sync="sideDrawerOpen" />
|
2021-11-14 02:17:33 +01:00
|
|
|
<div class="configContent" :class="`page-${currentPage}`">
|
2022-02-11 15:50:28 +01:00
|
|
|
<div v-show="isMobile" class="w-full pb-4 px-2 flex border-b border-white border-opacity-10 mb-2">
|
2022-11-21 14:18:10 +01:00
|
|
|
<span class="material-icons text-2xl cursor-pointer" @click.stop.prevent="showMore">more_vert</span>
|
2021-11-04 23:35:59 +01:00
|
|
|
<p class="pl-3 capitalize">{{ currentPage }}</p>
|
|
|
|
</div>
|
2021-10-23 03:08:02 +02:00
|
|
|
<nuxt-child />
|
|
|
|
</div>
|
|
|
|
<div class="fixed bottom-0 right-0 w-10 h-10" @dblclick="setDeveloperMode"></div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2021-12-29 22:53:19 +01:00
|
|
|
asyncData({ store, redirect, route }) {
|
2022-05-04 02:16:16 +02:00
|
|
|
if (!store.getters['user/getIsAdminOrUp']) {
|
2021-12-29 22:53:19 +01:00
|
|
|
// Non-Root user only has access to the listening stats page
|
|
|
|
if (route.name !== 'config-stats') {
|
|
|
|
redirect('/config/stats')
|
|
|
|
}
|
2021-10-23 03:08:02 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
2021-11-04 23:35:59 +01:00
|
|
|
return {
|
|
|
|
sideDrawerOpen: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
currentPage: {
|
|
|
|
handler() {
|
|
|
|
this.sideDrawerOpen = false
|
|
|
|
}
|
|
|
|
}
|
2021-10-23 03:08:02 +02:00
|
|
|
},
|
|
|
|
computed: {
|
2022-02-11 15:50:28 +01:00
|
|
|
isMobile() {
|
|
|
|
return this.$store.state.globals.isMobile
|
|
|
|
},
|
2022-03-14 01:34:31 +01:00
|
|
|
streamLibraryItem() {
|
|
|
|
return this.$store.state.streamLibraryItem
|
2021-11-04 23:35:59 +01:00
|
|
|
},
|
|
|
|
currentPage() {
|
2022-11-21 00:11:51 +01:00
|
|
|
if (!this.$route.name) return this.$strings.HeaderSettings
|
2021-11-04 23:35:59 +01:00
|
|
|
var routeName = this.$route.name.split('-')
|
2022-11-21 00:11:51 +01:00
|
|
|
if (routeName.length > 0) {
|
|
|
|
const pageName = routeName.slice(1).join('-')
|
|
|
|
if (pageName === 'log') return this.$strings.HeaderLogs
|
|
|
|
else if (pageName === 'backups') return this.$strings.HeaderBackups
|
|
|
|
else if (pageName === 'libraries') return this.$strings.HeaderLibraries
|
|
|
|
else if (pageName === 'notifications') return this.$strings.HeaderNotifications
|
|
|
|
else if (pageName === 'sessions') return this.$strings.HeaderListeningSessions
|
|
|
|
else if (pageName === 'stats') return this.$strings.HeaderYourStats
|
|
|
|
else if (pageName === 'library-stats') return this.$strings.HeaderLibraryStats
|
|
|
|
else if (pageName === 'users') return this.$strings.HeaderUsers
|
|
|
|
}
|
|
|
|
return this.$strings.HeaderSettings
|
2021-10-23 03:08:02 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2021-11-04 23:35:59 +01:00
|
|
|
showMore() {
|
|
|
|
this.sideDrawerOpen = true
|
|
|
|
},
|
2021-10-23 03:08:02 +02:00
|
|
|
setDeveloperMode() {
|
|
|
|
var value = !this.$store.state.developerMode
|
|
|
|
this.$store.commit('setDeveloperMode', value)
|
|
|
|
this.$toast.info(`Developer Mode ${value ? 'Enabled' : 'Disabled'}`)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|
2021-11-04 23:35:59 +01:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.configContent {
|
|
|
|
margin: auto;
|
|
|
|
width: 900px;
|
|
|
|
max-width: calc(100% - 176px);
|
|
|
|
}
|
2021-12-29 22:53:19 +01:00
|
|
|
.configContent.page-library-stats {
|
2021-11-14 02:17:33 +01:00
|
|
|
width: 1200px;
|
|
|
|
}
|
2022-08-06 15:10:12 +02:00
|
|
|
@media (max-width: 1550px) {
|
|
|
|
.configContent.page-library-stats {
|
|
|
|
margin-left: 176px;
|
|
|
|
}
|
|
|
|
}
|
2022-02-11 15:50:28 +01:00
|
|
|
@media (max-width: 1240px) {
|
2021-11-04 23:35:59 +01:00
|
|
|
.configContent {
|
|
|
|
margin-left: 176px;
|
|
|
|
}
|
|
|
|
}
|
2022-02-11 15:50:28 +01:00
|
|
|
@media (max-width: 640px) {
|
2021-11-04 23:35:59 +01:00
|
|
|
.configContent {
|
|
|
|
margin-left: 0px;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
2022-08-06 15:10:12 +02:00
|
|
|
.configContent.page-library-stats {
|
|
|
|
margin-left: 0px;
|
|
|
|
}
|
2021-11-04 23:35:59 +01:00
|
|
|
}
|
|
|
|
</style>
|