mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-06-20 20:05:44 +02:00
Add:Nav button in side drawer and item more menu to go to web client #1079
This commit is contained in:
parent
f04eebe0d8
commit
3c6d4b5f19
24 changed files with 69 additions and 7 deletions
|
@ -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() {
|
||||
|
|
|
@ -135,6 +135,14 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.isConnectedToServer && this.userIsAdminOrUp) {
|
||||
items.push({
|
||||
text: this.$strings.ButtonGoToWebClient,
|
||||
value: 'openWebClient',
|
||||
icon: 'language'
|
||||
})
|
||||
}
|
||||
|
||||
if (!this.episode) {
|
||||
items.push({
|
||||
text: this.$strings.LabelMoreInfo,
|
||||
|
@ -285,6 +293,8 @@ export default {
|
|||
this.clickRSSFeed()
|
||||
} else if (action === 'sendEbook') {
|
||||
this.showSendEbookDevicesModal = true
|
||||
} else if (action === 'openWebClient') {
|
||||
this.$store.dispatch('user/openWebClient', `/item/${this.serverLibraryItemId}`)
|
||||
}
|
||||
},
|
||||
async toggleFinished() {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { Browser } from '@capacitor/browser'
|
||||
|
||||
export const state = () => ({
|
||||
user: null,
|
||||
serverConnectionConfig: null,
|
||||
|
@ -115,6 +117,21 @@ export const actions = {
|
|||
commit('setSettings', userSettings)
|
||||
this.$eventBus.$emit('user-settings', state.settings)
|
||||
}
|
||||
},
|
||||
async openWebClient({ getters }, path = null) {
|
||||
const serverAddress = getters.getServerAddress
|
||||
if (!serverAddress) {
|
||||
console.error('openWebClient: No server address')
|
||||
return
|
||||
}
|
||||
try {
|
||||
let url = serverAddress.replace(/\/$/, '') // Remove trailing slash
|
||||
if (path?.startsWith('/')) url += path
|
||||
|
||||
await Browser.open({ url })
|
||||
} catch (error) {
|
||||
console.error('Error opening browser', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Smazat místní položku",
|
||||
"ButtonDisableAutoTimer": "Zakázat automatický časovač",
|
||||
"ButtonDisconnect": "Odpojit",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Historie",
|
||||
"ButtonHome": "Domů",
|
||||
"ButtonIssues": "Problémy",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Hjem",
|
||||
"ButtonIssues": "Problemer",
|
||||
|
@ -291,4 +292,4 @@
|
|||
"ToastPodcastCreateSuccess": "Podcast oprettet med succes",
|
||||
"ToastRSSFeedCloseFailed": "Mislykkedes lukning af RSS-feed",
|
||||
"ToastRSSFeedCloseSuccess": "RSS-feed lukket"
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Lösche lokales Element",
|
||||
"ButtonDisableAutoTimer": "Deaktiviere automatischen Timer",
|
||||
"ButtonDisconnect": "Trennen",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Historie",
|
||||
"ButtonHome": "Startseite",
|
||||
"ButtonIssues": "Probleme",
|
||||
|
@ -291,4 +292,4 @@
|
|||
"ToastPodcastCreateSuccess": "Podcast erstellt",
|
||||
"ToastRSSFeedCloseFailed": "RSS-Feed konnte nicht geschlossen werden",
|
||||
"ToastRSSFeedCloseSuccess": "RSS-Feed geschlossen"
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Home",
|
||||
"ButtonIssues": "Issues",
|
||||
|
@ -291,4 +292,4 @@
|
|||
"ToastPodcastCreateSuccess": "Podcast created successfully",
|
||||
"ToastRSSFeedCloseFailed": "Failed to close RSS feed",
|
||||
"ToastRSSFeedCloseSuccess": "RSS feed closed"
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Inicio",
|
||||
"ButtonIssues": "Problemas",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Accueil",
|
||||
"ButtonIssues": "Parutions",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "ઘર",
|
||||
"ButtonIssues": "સમસ્યાઓ",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "घर",
|
||||
"ButtonIssues": "समस्याएं",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Početna stranica",
|
||||
"ButtonIssues": "Problemi",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Helyi elem törlése",
|
||||
"ButtonDisableAutoTimer": "Automatikus időzítő letiltása",
|
||||
"ButtonDisconnect": "Kapcsolat bontása",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Előzmények",
|
||||
"ButtonHome": "Kezdőlap",
|
||||
"ButtonIssues": "Problémák",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Elimina oggetto locale",
|
||||
"ButtonDisableAutoTimer": "Disattiva Auto Timer",
|
||||
"ButtonDisconnect": "Disconnetti",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Cronologia",
|
||||
"ButtonHome": "Home",
|
||||
"ButtonIssues": "Errori",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Pradžia",
|
||||
"ButtonIssues": "Problemos",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Home",
|
||||
"ButtonIssues": "Issues",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Hjem",
|
||||
"ButtonIssues": "Problemer",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Usuń lokalny element",
|
||||
"ButtonDisableAutoTimer": "Wyłącz automatyczny wyłącznik",
|
||||
"ButtonDisconnect": "Rozłącz",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Historia",
|
||||
"ButtonHome": "Strona główna",
|
||||
"ButtonIssues": "Błędy",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Apagar item local",
|
||||
"ButtonDisableAutoTimer": "Desativar Timer Automático",
|
||||
"ButtonDisconnect": "Desconectar",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Histórico",
|
||||
"ButtonHome": "Principal",
|
||||
"ButtonIssues": "Problemas",
|
||||
|
@ -291,4 +292,4 @@
|
|||
"ToastPodcastCreateSuccess": "Podcast criado",
|
||||
"ToastRSSFeedCloseFailed": "Falha ao fechar feed RSS",
|
||||
"ToastRSSFeedCloseSuccess": "Feed RSS fechado"
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Удалить локальный элемент",
|
||||
"ButtonDisableAutoTimer": "Отключить автоматический таймер",
|
||||
"ButtonDisconnect": "Отключиться",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "История",
|
||||
"ButtonHome": "Домой",
|
||||
"ButtonIssues": "Проблемы",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Delete local item",
|
||||
"ButtonDisableAutoTimer": "Disable Auto Timer",
|
||||
"ButtonDisconnect": "Disconnect",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "History",
|
||||
"ButtonHome": "Hem",
|
||||
"ButtonIssues": "Problem",
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Видалити локальний елемент",
|
||||
"ButtonDisableAutoTimer": "Вимкнути автотаймер",
|
||||
"ButtonDisconnect": "Відключитися",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Історія",
|
||||
"ButtonHome": "Головна",
|
||||
"ButtonIssues": "Проблеми",
|
||||
|
@ -291,4 +292,4 @@
|
|||
"ToastPodcastCreateSuccess": "Подкаст успішно створено",
|
||||
"ToastRSSFeedCloseFailed": "Не вдалося закрити RSS-канал",
|
||||
"ToastRSSFeedCloseSuccess": "RSS-канал закрито"
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "Xóa mục địa phương",
|
||||
"ButtonDisableAutoTimer": "Tắt Bộ Đếm Tự Động",
|
||||
"ButtonDisconnect": "Ngắt Kết Nối",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "Lịch Sử",
|
||||
"ButtonHome": "Trang Chủ",
|
||||
"ButtonIssues": "Vấn Đề",
|
||||
|
@ -291,4 +292,4 @@
|
|||
"ToastPodcastCreateSuccess": "Tạo podcast thành công",
|
||||
"ToastRSSFeedCloseFailed": "Không thể đóng RSS feed",
|
||||
"ToastRSSFeedCloseSuccess": "Đóng RSS feed thành công"
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
"ButtonDeleteLocalItem": "删除本地项目",
|
||||
"ButtonDisableAutoTimer": "禁用自动定时器",
|
||||
"ButtonDisconnect": "断开连接",
|
||||
"ButtonGoToWebClient": "Go to Web Client",
|
||||
"ButtonHistory": "历史",
|
||||
"ButtonHome": "首页",
|
||||
"ButtonIssues": "问题",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue