Add:Nav button in side drawer and item more menu to go to web client #1079

This commit is contained in:
advplyr 2024-03-22 17:54:56 -05:00
parent f04eebe0d8
commit 3c6d4b5f19
24 changed files with 69 additions and 7 deletions

View file

@ -79,7 +79,10 @@ export default {
return this.$store.state.serverSettings || {}
},
username() {
return this.user ? this.user.username : ''
return this.user?.username || ''
},
userIsAdminOrUp() {
return this.$store.getters['user/getIsAdminOrUp']
},
navItems() {
var items = [
@ -132,6 +135,13 @@ export default {
})
if (this.serverConnectionConfig) {
if (this.userIsAdminOrUp) {
items.push({
icon: 'language',
text: this.$strings.ButtonGoToWebClient,
action: 'openWebClient'
})
}
items.push({
icon: 'login',
text: this.$strings.ButtonSwitchServerUser,
@ -151,6 +161,10 @@ export default {
if (action === 'logout') {
await this.logout()
this.$router.push('/connect')
} else if (action === 'openWebClient') {
this.show = false
let path = `/library/${this.$store.state.libraries.currentLibraryId}`
await this.$store.dispatch('user/openWebClient', path)
}
},
clickBackground() {