2021-10-23 03:08:02 +02:00
|
|
|
<template>
|
|
|
|
<div id="page-wrapper" class="page p-6 overflow-y-auto relative" :class="streamAudiobook ? '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}`">
|
2021-11-04 23:35:59 +01:00
|
|
|
<div class="w-full pb-4 px-2 flex md:hidden border-b border-white border-opacity-10 mb-2">
|
|
|
|
<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 }) {
|
2021-10-23 03:08:02 +02:00
|
|
|
if (!store.getters['user/getIsRoot']) {
|
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: {
|
|
|
|
streamAudiobook() {
|
|
|
|
return this.$store.state.streamAudiobook
|
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'}`)
|
|
|
|
}
|
|
|
|
// saveMetadataComplete(result) {
|
|
|
|
// this.savingMetadata = false
|
|
|
|
// if (!result) return
|
|
|
|
// this.$toast.success(`Metadata saved for ${result.success} audiobooks`)
|
|
|
|
// },
|
|
|
|
// saveMetadataFiles() {
|
|
|
|
// this.savingMetadata = true
|
|
|
|
// this.$root.socket.once('save_metadata_complete', this.saveMetadataComplete)
|
|
|
|
// this.$root.socket.emit('save_metadata')
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
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;
|
|
|
|
}
|
2021-11-04 23:35:59 +01:00
|
|
|
@media (max-width: 1024px) {
|
|
|
|
.configContent {
|
|
|
|
margin-left: 176px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
.configContent {
|
|
|
|
margin-left: 0px;
|
|
|
|
width: 100%;
|
|
|
|
max-width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|