2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
2022-05-29 18:49:00 +02:00
|
|
|
<nav
|
2023-07-01 09:48:38 +02:00
|
|
|
class="navbar is-light is-fixed-top"
|
2022-05-29 18:49:00 +02:00
|
|
|
:style="zindex"
|
|
|
|
role="navigation"
|
|
|
|
aria-label="main navigation"
|
|
|
|
>
|
2018-08-11 07:47:10 +02:00
|
|
|
<div class="navbar-brand">
|
2024-09-09 21:00:35 +02:00
|
|
|
<control-link
|
2024-08-22 21:31:59 +02:00
|
|
|
v-if="settingsStore.show_menu_item_playlists"
|
2024-09-09 21:00:35 +02:00
|
|
|
class="navbar-item"
|
2024-08-22 21:31:59 +02:00
|
|
|
:to="{ name: 'playlists' }"
|
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="music-box-multiple" size="16" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
2024-08-22 21:31:59 +02:00
|
|
|
v-if="settingsStore.show_menu_item_music"
|
2024-09-09 21:00:35 +02:00
|
|
|
class="navbar-item"
|
2024-08-22 21:31:59 +02:00
|
|
|
:to="{ name: 'music' }"
|
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="music" size="16" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
2024-08-22 21:31:59 +02:00
|
|
|
v-if="settingsStore.show_menu_item_podcasts"
|
2024-09-09 21:00:35 +02:00
|
|
|
class="navbar-item"
|
2024-08-22 21:31:59 +02:00
|
|
|
:to="{ name: 'podcasts' }"
|
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="microphone" size="16" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
2024-08-22 21:31:59 +02:00
|
|
|
v-if="settingsStore.show_menu_item_audiobooks"
|
2024-09-09 21:00:35 +02:00
|
|
|
class="navbar-item"
|
2024-08-22 21:31:59 +02:00
|
|
|
:to="{ name: 'audiobooks' }"
|
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="book-open-variant" size="16" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
2024-08-22 21:31:59 +02:00
|
|
|
v-if="settingsStore.show_menu_item_radio"
|
2024-09-09 21:00:35 +02:00
|
|
|
class="navbar-item"
|
2024-08-22 21:31:59 +02:00
|
|
|
:to="{ name: 'radio' }"
|
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="radio" size="16" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
2024-08-22 21:31:59 +02:00
|
|
|
v-if="settingsStore.show_menu_item_files"
|
2024-09-09 21:00:35 +02:00
|
|
|
class="navbar-item"
|
2024-08-22 21:31:59 +02:00
|
|
|
:to="{ name: 'files' }"
|
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="folder-open" size="16" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
2024-08-22 21:31:59 +02:00
|
|
|
v-if="settingsStore.show_menu_item_search"
|
2024-09-09 21:00:35 +02:00
|
|
|
class="navbar-item"
|
2024-08-22 21:31:59 +02:00
|
|
|
:to="{ name: searchStore.search_source }"
|
|
|
|
>
|
2023-06-30 21:41:40 +02:00
|
|
|
<mdicon class="icon" name="magnify" size="16" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
</div>
|
|
|
|
<div class="navbar-end">
|
|
|
|
<a
|
|
|
|
class="navbar-item"
|
|
|
|
@click="uiStore.show_burger_menu = !uiStore.show_burger_menu"
|
|
|
|
>
|
|
|
|
<mdicon
|
|
|
|
class="icon"
|
|
|
|
:name="uiStore.show_burger_menu ? 'close' : 'menu'"
|
|
|
|
/>
|
|
|
|
</a>
|
2022-05-29 18:49:00 +02:00
|
|
|
<div
|
2024-09-09 21:00:35 +02:00
|
|
|
class="dropdown is-right"
|
|
|
|
:class="{ 'is-active': uiStore.show_burger_menu }"
|
2022-05-29 18:49:00 +02:00
|
|
|
>
|
2024-09-09 21:00:35 +02:00
|
|
|
<div class="dropdown-menu">
|
|
|
|
<div class="dropdown-content">
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'playlists' }">
|
|
|
|
<span class="icon-text">
|
|
|
|
<mdicon class="icon" name="music-box-multiple" size="16" />
|
|
|
|
</span>
|
2022-05-20 13:44:22 +02:00
|
|
|
<b v-text="$t('navigation.playlists')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'music' }">
|
|
|
|
<span class="icon-text">
|
|
|
|
<mdicon class="icon" name="music" size="16" />
|
|
|
|
</span>
|
2022-05-20 13:44:22 +02:00
|
|
|
<b v-text="$t('navigation.music')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'music-artists' }">
|
2023-07-05 22:24:50 +02:00
|
|
|
<span class="pl-5" v-text="$t('navigation.artists')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'music-albums' }">
|
2023-07-05 22:24:50 +02:00
|
|
|
<span class="pl-5" v-text="$t('navigation.albums')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'music-genres' }">
|
2023-07-05 22:24:50 +02:00
|
|
|
<span class="pl-5" v-text="$t('navigation.genres')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
|
|
|
class="dropdown-item"
|
2023-07-10 10:37:45 +02:00
|
|
|
v-if="spotify_enabled"
|
2023-07-12 21:30:52 +02:00
|
|
|
:to="{ name: 'music-spotify' }"
|
2023-07-10 10:37:45 +02:00
|
|
|
>
|
2023-07-05 22:24:50 +02:00
|
|
|
<span class="pl-5" v-text="$t('navigation.spotify')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'podcasts' }">
|
|
|
|
<span class="icon-text">
|
|
|
|
<mdicon class="icon" name="microphone" size="16" />
|
|
|
|
</span>
|
2022-05-20 13:44:22 +02:00
|
|
|
<b v-text="$t('navigation.podcasts')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'audiobooks' }">
|
|
|
|
<span class="icon-text">
|
|
|
|
<mdicon class="icon" name="book-open-variant" size="16" />
|
|
|
|
</span>
|
2022-05-20 13:44:22 +02:00
|
|
|
<b v-text="$t('navigation.audiobooks')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'radio' }">
|
|
|
|
<span class="icon-text">
|
|
|
|
<mdicon class="icon" name="radio" size="16" />
|
|
|
|
</span>
|
2022-05-20 13:44:22 +02:00
|
|
|
<b v-text="$t('navigation.radio')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link class="dropdown-item" :to="{ name: 'files' }">
|
|
|
|
<span class="icon-text">
|
|
|
|
<mdicon class="icon" name="folder-open" size="16" />
|
|
|
|
</span>
|
2022-05-20 13:44:22 +02:00
|
|
|
<b v-text="$t('navigation.files')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
|
|
|
<control-link
|
|
|
|
class="dropdown-item"
|
|
|
|
:to="{ name: searchStore.search_source }"
|
|
|
|
>
|
|
|
|
<span class="icon-text">
|
|
|
|
<mdicon class="icon" name="magnify" size="16" />
|
|
|
|
</span>
|
2022-05-20 13:44:22 +02:00
|
|
|
<b v-text="$t('navigation.search')" />
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
2023-07-03 12:21:49 +02:00
|
|
|
<hr class="my-3" />
|
2024-09-09 21:00:35 +02:00
|
|
|
<control-link
|
|
|
|
class="dropdown-item"
|
|
|
|
:to="{ name: 'settings-webinterface' }"
|
|
|
|
>
|
2024-04-21 17:44:55 +02:00
|
|
|
{{ $t('navigation.settings') }}
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
2022-05-29 18:49:00 +02:00
|
|
|
<a
|
2024-09-09 21:00:35 +02:00
|
|
|
class="dropdown-item"
|
2022-05-29 18:49:00 +02:00
|
|
|
@click.stop.prevent="open_update_dialog()"
|
|
|
|
v-text="$t('navigation.update-library')"
|
|
|
|
/>
|
2024-09-09 21:00:35 +02:00
|
|
|
<control-link class="dropdown-item" :to="{ name: 'about' }">
|
2024-04-21 17:44:55 +02:00
|
|
|
{{ $t('navigation.about') }}
|
2024-09-09 21:00:35 +02:00
|
|
|
</control-link>
|
2018-08-11 07:47:10 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-05-29 18:49:00 +02:00
|
|
|
<div
|
|
|
|
v-show="show_settings_menu"
|
|
|
|
class="is-overlay"
|
|
|
|
@click="show_settings_menu = false"
|
|
|
|
/>
|
2018-08-11 07:47:10 +02:00
|
|
|
</nav>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-09-09 21:00:35 +02:00
|
|
|
import ControlLink from '@/components/ControlLink.vue'
|
2024-08-22 21:31:59 +02:00
|
|
|
import { useSearchStore } from '@/stores/search'
|
|
|
|
import { useServicesStore } from '@/stores/services'
|
|
|
|
import { useSettingsStore } from '@/stores/settings'
|
|
|
|
import { useUIStore } from '@/stores/ui'
|
2018-08-11 07:47:10 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'NavbarTop',
|
2024-09-09 21:00:35 +02:00
|
|
|
components: { ControlLink },
|
2018-08-11 07:47:10 +02:00
|
|
|
|
2024-08-22 21:31:59 +02:00
|
|
|
setup() {
|
|
|
|
return {
|
|
|
|
searchStore: useSearchStore(),
|
|
|
|
servicesStore: useServicesStore(),
|
|
|
|
settingsStore: useSettingsStore(),
|
|
|
|
uiStore: useUIStore()
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
data() {
|
2018-08-11 07:47:10 +02:00
|
|
|
return {
|
2022-01-09 18:29:24 +01:00
|
|
|
show_settings_menu: false
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
2024-03-26 12:04:04 +01:00
|
|
|
spotify_enabled() {
|
2024-08-22 21:31:59 +02:00
|
|
|
return this.servicesStore.spotify.webapi_token_valid
|
2023-07-12 22:39:21 +02:00
|
|
|
},
|
2022-02-19 06:39:14 +01:00
|
|
|
zindex() {
|
2024-08-22 21:31:59 +02:00
|
|
|
if (this.uiStore.show_player_menu) {
|
2023-12-14 20:30:34 +01:00
|
|
|
return 'z-index: 21'
|
2019-02-14 12:19:29 +01:00
|
|
|
}
|
2020-04-18 06:57:55 +02:00
|
|
|
return ''
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
2019-02-14 12:19:29 +01:00
|
|
|
},
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
watch: {
|
|
|
|
$route(to, from) {
|
|
|
|
this.show_settings_menu = false
|
2019-02-16 06:48:45 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
methods: {
|
|
|
|
on_click_outside_settings() {
|
|
|
|
this.show_settings_menu = !this.show_settings_menu
|
2022-02-19 07:05:59 +01:00
|
|
|
},
|
|
|
|
open_update_dialog() {
|
2024-09-09 21:00:35 +02:00
|
|
|
this.uiStore.show_update_dialog = true
|
2022-02-19 07:05:59 +01:00
|
|
|
this.show_settings_menu = false
|
2024-09-09 21:00:35 +02:00
|
|
|
this.uiStore.show_burger_menu = false
|
2020-04-18 06:57:55 +02:00
|
|
|
}
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|