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}`">
|
2023-01-01 19:41:46 +01:00
|
|
|
<div v-show="isMobilePortrait" class="w-full pb-4 px-2 flex border-b border-white border-opacity-10 mb-2 cursor-pointer" @click.stop.prevent="toggleShowMore">
|
2024-07-08 18:36:37 +02:00
|
|
|
<span class="material-symbols text-2xl cursor-pointer">arrow_forward</span>
|
2023-05-30 00:38:38 +02:00
|
|
|
<p class="pl-3 capitalize">{{ currentPage }}</p>
|
2021-11-04 23:35:59 +01:00
|
|
|
</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: {
|
2023-01-01 19:41:46 +01:00
|
|
|
isMobilePortrait() {
|
|
|
|
return this.$store.state.globals.isMobilePortrait
|
2022-02-11 15:50:28 +01:00
|
|
|
},
|
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 === 'users') return this.$strings.HeaderUsers
|
2022-12-18 22:11:48 +01:00
|
|
|
else if (pageName === 'item-metadata-utils') return this.$strings.HeaderItemMetadataUtils
|
2023-08-22 18:42:55 +02:00
|
|
|
else if (pageName === 'rss-feeds') return this.$strings.HeaderRSSFeeds
|
2023-05-30 00:38:38 +02:00
|
|
|
else if (pageName === 'email') return this.$strings.HeaderEmail
|
2023-09-24 22:36:35 +02:00
|
|
|
else if (pageName === 'authentication') return this.$strings.HeaderAuthentication
|
2022-11-21 00:11:51 +01:00
|
|
|
}
|
|
|
|
return this.$strings.HeaderSettings
|
2021-10-23 03:08:02 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2023-01-01 19:41:46 +01:00
|
|
|
toggleShowMore() {
|
|
|
|
this.sideDrawerOpen = !this.sideDrawerOpen
|
2021-11-04 23:35:59 +01:00
|
|
|
},
|
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);
|
|
|
|
}
|
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%;
|
|
|
|
}
|
|
|
|
}
|
2024-07-13 22:26:07 +02:00
|
|
|
</style>
|