mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-09-10 17:58:02 +02:00
added client code
This commit is contained in:
parent
7c0a746e7d
commit
8c7d911ca7
@ -87,6 +87,12 @@
|
|||||||
|
|
||||||
<ui-context-menu-dropdown v-if="contextMenuItems.length" :items="contextMenuItems" :menu-width="110" class="ml-2" @action="contextMenuAction" />
|
<ui-context-menu-dropdown v-if="contextMenuItems.length" :items="contextMenuItems" :menu-width="110" class="ml-2" @action="contextMenuAction" />
|
||||||
</template>
|
</template>
|
||||||
|
<!-- library stats page -->
|
||||||
|
<template v-else-if="isLibraryStatsPage">
|
||||||
|
<div class="flex-grow" />
|
||||||
|
<ui-btn color="primary" small @click="updateLibraryStats">
|
||||||
|
{{ this.showAllLibraryStats ? currentLibraryName : $strings.LabelShowAll }}</ui-btn>
|
||||||
|
</template>
|
||||||
<!-- search page -->
|
<!-- search page -->
|
||||||
<template v-else-if="page === 'search'">
|
<template v-else-if="page === 'search'">
|
||||||
<div class="flex-grow" />
|
<div class="flex-grow" />
|
||||||
@ -131,7 +137,8 @@ export default {
|
|||||||
totalEntities: 0,
|
totalEntities: 0,
|
||||||
processingSeries: false,
|
processingSeries: false,
|
||||||
processingIssues: false,
|
processingIssues: false,
|
||||||
processingAuthors: false
|
processingAuthors: false,
|
||||||
|
showAllLibraryStats: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -235,6 +242,9 @@ export default {
|
|||||||
currentLibraryId() {
|
currentLibraryId() {
|
||||||
return this.$store.state.libraries.currentLibraryId
|
return this.$store.state.libraries.currentLibraryId
|
||||||
},
|
},
|
||||||
|
currentLibraryName() {
|
||||||
|
return this.$store.getters['libraries/getCurrentLibraryName']
|
||||||
|
},
|
||||||
libraryProvider() {
|
libraryProvider() {
|
||||||
return this.$store.getters['libraries/getLibraryProvider'](this.currentLibraryId) || 'google'
|
return this.$store.getters['libraries/getLibraryProvider'](this.currentLibraryId) || 'google'
|
||||||
},
|
},
|
||||||
@ -259,6 +269,9 @@ export default {
|
|||||||
isPlaylistsPage() {
|
isPlaylistsPage() {
|
||||||
return this.page === 'playlists'
|
return this.page === 'playlists'
|
||||||
},
|
},
|
||||||
|
isLibraryStatsPage() {
|
||||||
|
return this.page === 'library-stats'
|
||||||
|
},
|
||||||
isHomePage() {
|
isHomePage() {
|
||||||
return this.$route.name === 'library-library'
|
return this.$route.name === 'library-library'
|
||||||
},
|
},
|
||||||
@ -606,6 +619,12 @@ export default {
|
|||||||
updateAuthorSort() {
|
updateAuthorSort() {
|
||||||
this.saveSettings()
|
this.saveSettings()
|
||||||
},
|
},
|
||||||
|
updateLibraryStats() {
|
||||||
|
this.$emit('library-stats-updated', !this.showAllLibraryStats)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.showAllLibraryStats = !this.showAllLibraryStats
|
||||||
|
})
|
||||||
|
},
|
||||||
saveSettings() {
|
saveSettings() {
|
||||||
this.$store.dispatch('user/updateUserSettings', this.settings)
|
this.$store.dispatch('user/updateUserSettings', this.settings)
|
||||||
},
|
},
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page relative" :class="streamLibraryItem ? 'streaming' : ''">
|
<div class="page relative" :class="streamLibraryItem ? 'streaming' : ''">
|
||||||
<app-book-shelf-toolbar page="library-stats" is-home />
|
<app-book-shelf-toolbar page="library-stats" is-home @library-stats-updated="toggleStats" />
|
||||||
<ui-btn class="text-xs" :padding-x="1.5" :padding-y="1" @click="toggleStats">
|
|
||||||
{{ showAllLibraryStats ? currentLibraryName : 'Show all Libraries' }}</ui-btn>
|
|
||||||
<div id="bookshelf" class="w-full h-full px-1 py-4 md:p-8 relative overflow-y-auto">
|
<div id="bookshelf" class="w-full h-full px-1 py-4 md:p-8 relative overflow-y-auto">
|
||||||
<div class="w-full max-w-4xl mx-auto">
|
<div class="w-full max-w-4xl mx-auto">
|
||||||
<stats-preview-icons v-if="totalItems" :library-stats="libraryStats" />
|
<stats-preview-icons v-if="totalItems" :library-stats="libraryStats" />
|
||||||
@ -164,9 +162,6 @@ export default {
|
|||||||
currentLibraryId() {
|
currentLibraryId() {
|
||||||
return this.$store.state.libraries.currentLibraryId
|
return this.$store.state.libraries.currentLibraryId
|
||||||
},
|
},
|
||||||
currentLibraryName() {
|
|
||||||
return this.$store.getters['libraries/getCurrentLibraryName']
|
|
||||||
},
|
|
||||||
currentLibraryMediaType() {
|
currentLibraryMediaType() {
|
||||||
return this.$store.getters['libraries/getCurrentLibraryMediaType']
|
return this.$store.getters['libraries/getCurrentLibraryMediaType']
|
||||||
},
|
},
|
||||||
@ -191,8 +186,8 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggleStats() {
|
toggleStats(value) {
|
||||||
this.showAllLibraryStats = !this.showAllLibraryStats;
|
this.showAllLibraryStats = value;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.init();
|
this.init();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user