2021-10-23 03:08:02 +02:00
|
|
|
<template>
|
2022-03-14 01:34:31 +01:00
|
|
|
<div id="page-wrapper" class="page 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">
|
2021-11-04 23:35:59 +01:00
|
|
|
<span class="material-icons cursor-pointer" @click.stop.prevent="showMore">more_vert</span>
|
|
|
|
<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() {
|
|
|
|
if (!this.$route.name) return 'Settings'
|
|
|
|
var routeName = this.$route.name.split('-')
|
2021-12-29 22:53:19 +01:00
|
|
|
if (routeName.length > 0) return routeName.slice(1).join('-')
|
2021-11-04 23:35:59 +01:00
|
|
|
return 'Settings'
|
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-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%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|