mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-03 23:30:09 -05:00
[web] Simplify the modal dialog with actions
This commit is contained in:
parent
8e82fc9f9f
commit
a1e68a1aa6
@ -48,12 +48,11 @@
|
|||||||
@play-count-changed="play_count_changed()"
|
@play-count-changed="play_count_changed()"
|
||||||
/>
|
/>
|
||||||
<modal-dialog-action
|
<modal-dialog-action
|
||||||
:close_action="$t('page.podcast.cancel')"
|
:actions="actions"
|
||||||
:delete_action="$t('page.podcast.remove')"
|
|
||||||
:show="show_remove_podcast_modal"
|
:show="show_remove_podcast_modal"
|
||||||
:title="$t('page.podcast.remove-podcast')"
|
:title="$t('page.podcast.remove-podcast')"
|
||||||
@close="show_remove_podcast_modal = false"
|
@cancel="show_remove_podcast_modal = false"
|
||||||
@delete="remove_podcast"
|
@remove="remove_podcast"
|
||||||
>
|
>
|
||||||
<template #modal-content>
|
<template #modal-content>
|
||||||
<i18n-t keypath="list.albums.info" tag="p" scope="global">
|
<i18n-t keypath="list.albums.info" tag="p" scope="global">
|
||||||
@ -99,6 +98,20 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('page.podcast.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
icon: 'cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('page.podcast.remove'),
|
||||||
|
event: 'remove',
|
||||||
|
icon: 'delete'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
media_kind_resolved() {
|
media_kind_resolved() {
|
||||||
return this.media_kind || this.selected_item.media_kind
|
return this.media_kind || this.selected_item.media_kind
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog :show="show">
|
||||||
<template #content>
|
<template #content>
|
||||||
<p v-if="title" class="title is-4" v-text="title" />
|
<p v-if="title" class="title is-4" v-text="title" />
|
||||||
<slot name="modal-content" />
|
<slot name="modal-content" />
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<a class="card-footer-item has-text-dark" @click="$emit('close')">
|
<a
|
||||||
<mdicon class="icon" name="cancel" size="16" />
|
v-for="action in actions"
|
||||||
<span class="is-size-7" v-text="close_action" />
|
:key="action.event"
|
||||||
</a>
|
class="card-footer-item"
|
||||||
<a v-if="delete_action" class="card-footer-item" @click="$emit('delete')">
|
:class="{ 'is-disabled': action.disabled }"
|
||||||
<mdicon class="icon" name="delete" size="16" />
|
@click="$emit(action.event)"
|
||||||
<span class="is-size-7" v-text="delete_action" />
|
>
|
||||||
</a>
|
<mdicon class="icon" :name="action.icon" size="16" />
|
||||||
<a v-if="ok_action" class="card-footer-item" @click="$emit('ok')">
|
<span class="is-size-7" v-text="action.label" />
|
||||||
<mdicon class="icon" name="check" size="16" />
|
|
||||||
<span class="is-size-7" v-text="ok_action" />
|
|
||||||
</a>
|
</a>
|
||||||
</template>
|
</template>
|
||||||
</modal-dialog>
|
</modal-dialog>
|
||||||
@ -28,13 +26,10 @@ export default {
|
|||||||
name: 'ModalDialogAction',
|
name: 'ModalDialogAction',
|
||||||
components: { ModalDialog },
|
components: { ModalDialog },
|
||||||
props: {
|
props: {
|
||||||
close_action: { default: '', type: String },
|
actions: { type: Array, required: true },
|
||||||
delete_action: { default: '', type: String },
|
|
||||||
ok_action: { default: '', type: String },
|
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
title: { required: true, type: String }
|
title: { default: '', type: String }
|
||||||
},
|
},
|
||||||
emits: ['delete', 'close', 'ok'],
|
|
||||||
watch: {
|
watch: {
|
||||||
show() {
|
show() {
|
||||||
const { classList } = document.querySelector('html')
|
const { classList } = document.querySelector('html')
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@cancel="$emit('close')"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@add="add"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<p class="title is-4" v-text="$t('dialog.add.rss.title')" />
|
<p class="title is-4" v-text="$t('dialog.add.rss.title')" />
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<p class="control has-icons-left">
|
<p class="control has-icons-left">
|
||||||
@ -20,39 +26,18 @@
|
|||||||
<p class="help" v-text="$t('dialog.add.rss.help')" />
|
<p class="help" v-text="$t('dialog.add.rss.help')" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="loading" #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark">
|
|
||||||
<mdicon class="icon" name="web" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.add.rss.processing')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
<template v-else #footer>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="$emit('close')">
|
|
||||||
<mdicon class="icon" name="cancel" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.add.rss.cancel')" />
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
:class="{ 'is-disabled': disabled }"
|
|
||||||
class="card-footer-item"
|
|
||||||
@click="add_stream"
|
|
||||||
>
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.add.rss.add')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogAddRss',
|
name: 'ModalDialogAddRss',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { show: Boolean },
|
props: { show: Boolean },
|
||||||
emits: ['close', 'podcast-added'],
|
emits: ['close', 'podcast-added'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
@ -60,7 +45,26 @@ export default {
|
|||||||
url: ''
|
url: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
if (this.loading) {
|
||||||
|
return [{ label: this.$t('dialog.add.rss.processing'), icon: 'web' }]
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.add.rss.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
icon: 'cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.add.rss.add'),
|
||||||
|
disabled: this.disabled,
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
show() {
|
show() {
|
||||||
if (this.show) {
|
if (this.show) {
|
||||||
@ -72,9 +76,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
add_stream() {
|
add() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
webapi
|
webapi
|
||||||
.library_add(this.url)
|
.library_add(this.url)
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="add"
|
||||||
|
@cancel="$emit('close')"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<form @submit.prevent="play">
|
<form @submit.prevent="play">
|
||||||
<p class="title is-4" v-text="$t('dialog.add.stream.title')" />
|
<p class="title is-4" v-text="$t('dialog.add.stream.title')" />
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@ -21,47 +28,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="loading" #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark">
|
|
||||||
<mdicon class="icon" name="web" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.add.stream.loading')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
<template v-else #footer>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="$emit('close')">
|
|
||||||
<mdicon class="icon" name="cancel" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.add.stream.cancel')" />
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
:class="{ 'is-disabled': disabled }"
|
|
||||||
class="card-footer-item has-text-dark"
|
|
||||||
@click="add_stream"
|
|
||||||
>
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.add.stream.add')" />
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
:class="{ 'is-disabled': disabled }"
|
|
||||||
class="card-footer-item has-text-dark"
|
|
||||||
@click="play"
|
|
||||||
>
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.add.stream.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogAddUrlStream',
|
name: 'ModalDialogAddUrlStream',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { show: Boolean },
|
props: { show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
@ -69,7 +47,32 @@ export default {
|
|||||||
url: ''
|
url: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
if (this.loading) {
|
||||||
|
return [{ label: this.$t('dialog.add.stream.processing'), icon: 'web' }]
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.add.stream.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
icon: 'cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.add.stream.add'),
|
||||||
|
disabled: this.disabled,
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.add.stream.play'),
|
||||||
|
disabled: this.disabled,
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
show() {
|
show() {
|
||||||
if (this.show) {
|
if (this.show) {
|
||||||
@ -81,9 +84,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
add_stream() {
|
add() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
webapi
|
webapi
|
||||||
.queue_add(this.url)
|
.queue_add(this.url)
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open" v-text="item.name" />
|
<a @click="open" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -77,31 +84,17 @@
|
|||||||
<div class="title is-6" v-text="$filters.datetime(item.time_added)" />
|
<div class="title is-6" v-text="$filters.datetime(item.time_added)" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.album.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.album.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.album.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CoverArtwork from '@/components/CoverArtwork.vue'
|
import CoverArtwork from '@/components/CoverArtwork.vue'
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogAlbum',
|
name: 'ModalDialogAlbum',
|
||||||
components: { ModalDialog, CoverArtwork },
|
components: { ModalDialogAction, CoverArtwork },
|
||||||
props: {
|
props: {
|
||||||
item: { required: true, type: Object },
|
item: { required: true, type: Object },
|
||||||
media_kind: { default: '', type: String },
|
media_kind: { default: '', type: String },
|
||||||
@ -116,6 +109,25 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.album.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.album.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.album.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
media_kind_resolved() {
|
media_kind_resolved() {
|
||||||
return this.media_kind || this.item.media_kind
|
return this.media_kind || this.item.media_kind
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open" v-text="item.name" />
|
<a @click="open" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -36,40 +43,45 @@
|
|||||||
<div class="title is-6" v-text="item.album_type" />
|
<div class="title is-6" v-text="item.album_type" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.album.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.album.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.album.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import CoverArtwork from '@/components/CoverArtwork.vue'
|
import CoverArtwork from '@/components/CoverArtwork.vue'
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogAlbumSpotify',
|
name: 'ModalDialogAlbumSpotify',
|
||||||
components: { ModalDialog, CoverArtwork },
|
components: { ModalDialogAction, CoverArtwork },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
artwork_visible: false
|
artwork_visible: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.album.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.album.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.album.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
artwork_error() {
|
artwork_error() {
|
||||||
this.artwork_visible = false
|
this.artwork_visible = false
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open" v-text="item.name" />
|
<a @click="open" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -30,33 +37,39 @@
|
|||||||
<div class="title is-6" v-text="$filters.datetime(item.time_added)" />
|
<div class="title is-6" v-text="$filters.datetime(item.time_added)" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.artist.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.artist.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.artist.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogArtist',
|
name: 'ModalDialogArtist',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.artist.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.artist.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.artist.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open" v-text="item.name" />
|
<a @click="open" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -22,33 +29,39 @@
|
|||||||
<div class="title is-6" v-text="item.genres.join(', ')" />
|
<div class="title is-6" v-text="item.genres.join(', ')" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.artist.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.artist.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.artist.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogArtistSpotify',
|
name: 'ModalDialogArtistSpotify',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.artist.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.artist.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.artist.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open_albums" v-text="item.name" />
|
<a @click="open_albums" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -33,33 +40,39 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.composer.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.composer.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.composer.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogComposer',
|
name: 'ModalDialogComposer',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.composer.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.composer.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.composer.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open_albums() {
|
open_albums() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -1,35 +1,45 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
<p class="title is-4" v-text="item" />
|
:show="show"
|
||||||
</template>
|
:title="item"
|
||||||
<template #footer>
|
@add="queue_add"
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
@add-next="queue_add_next"
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
@close="$emit('close')"
|
||||||
<span class="is-size-7" v-text="$t('dialog.directory.add')" />
|
@play="play"
|
||||||
</a>
|
/>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.directory.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.directory.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogDirectory',
|
name: 'ModalDialogDirectory',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: String }, show: Boolean },
|
props: { item: { required: true, type: String }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.directory.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.directory.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.directory.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
play() {
|
play() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open" v-text="item.name" />
|
<a @click="open" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -29,38 +36,42 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.genre.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.genre.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.genre.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogGenre',
|
name: 'ModalDialogGenre',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: {
|
props: {
|
||||||
item: { required: true, type: Object },
|
item: { required: true, type: Object },
|
||||||
media_kind: { required: true, type: String },
|
media_kind: { required: true, type: String },
|
||||||
show: Boolean
|
show: Boolean
|
||||||
},
|
},
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.genre.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.genre.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.genre.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
expression() {
|
expression() {
|
||||||
return `genre is "${this.item.name}" and media_kind is ${this.media_kind}`
|
return `genre is "${this.item.name}" and media_kind is ${this.media_kind}`
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open" v-text="item.name" />
|
<a @click="open" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -26,37 +33,46 @@
|
|||||||
<div class="title is-6" v-text="item.item_count" />
|
<div class="title is-6" v-text="item.item_count" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="!item.folder" #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.playlist.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.playlist.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.playlist.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogPlaylist',
|
name: 'ModalDialogPlaylist',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: {
|
props: {
|
||||||
item: { required: true, type: Object },
|
item: { required: true, type: Object },
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
uris: { default: '', type: String }
|
uris: { default: '', type: String }
|
||||||
},
|
},
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
if (!this.item.folder) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.playlist.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.playlist.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.playlist.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@cancel="$emit('close')"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@save="save"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<form @submit.prevent="save">
|
<form @submit.prevent="save">
|
||||||
<p class="title is-4" v-text="$t('dialog.playlist.save.title')" />
|
<p class="title is-4" v-text="$t('dialog.playlist.save.title')" />
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@ -21,39 +27,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="loading" #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark">
|
|
||||||
<mdicon class="icon" name="web" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.playlist.save.saving')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
<template v-else #footer>
|
|
||||||
<a class="card-footer-item has-text-danger" @click="$emit('close')">
|
|
||||||
<mdicon class="icon" name="cancel" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.playlist.save.cancel')" />
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
:class="{ 'is-disabled': disabled }"
|
|
||||||
class="card-footer-item has-text-weight-bold"
|
|
||||||
@click="save"
|
|
||||||
>
|
|
||||||
<mdicon class="icon" name="content-save" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.playlist.save.save')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogPlaylistSave',
|
name: 'ModalDialogPlaylistSave',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { show: Boolean },
|
props: { show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
@ -61,7 +46,23 @@ export default {
|
|||||||
playlist_name: ''
|
playlist_name: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
actions() {
|
||||||
|
if (loading) {
|
||||||
|
return [{ label: this.$t('dialog.playlist.save.saving'), icon: 'web' }]
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.playlist.save.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
icon: 'cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.playlist.save.save'),
|
||||||
|
event: 'content-save',
|
||||||
|
icon: 'save'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
show() {
|
show() {
|
||||||
if (this.show) {
|
if (this.show) {
|
||||||
@ -73,7 +74,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
check_name(event) {
|
check_name(event) {
|
||||||
const { validity } = event.target
|
const { validity } = event.target
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4">
|
<div class="title is-4">
|
||||||
<a @click="open" v-text="item.name" />
|
<a @click="open" v-text="item.name" />
|
||||||
</div>
|
</div>
|
||||||
@ -26,36 +33,39 @@
|
|||||||
<div class="title is-6" v-text="item.uri" />
|
<div class="title is-6" v-text="item.uri" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.playlist.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span
|
|
||||||
class="is-size-7"
|
|
||||||
v-text="$t('dialog.spotify.playlist.add-next')"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.playlist.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogPlaylistSpotify',
|
name: 'ModalDialogPlaylistSpotify',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.playlist.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.playlist.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.playlist.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@remove="remove"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<div class="title is-4" v-text="item.title" />
|
<div class="title is-4" v-text="item.title" />
|
||||||
<div class="subtitle" v-text="item.artist" />
|
<div class="subtitle" v-text="item.artist" />
|
||||||
<div v-if="item.album" class="mb-3">
|
<div v-if="item.album" class="mb-3">
|
||||||
@ -114,41 +120,44 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="remove">
|
|
||||||
<mdicon class="icon" name="delete" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.queue-item.remove')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.queue-item.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import SpotifyWebApi from 'spotify-web-api-js'
|
import SpotifyWebApi from 'spotify-web-api-js'
|
||||||
import { useServicesStore } from '@/stores/services'
|
import { useServicesStore } from '@/stores/services'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogQueueItem',
|
name: 'ModalDialogQueueItem',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
return { servicesStore: useServicesStore() }
|
return { servicesStore: useServicesStore() }
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
spotify_track: {}
|
spotify_track: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.queue-item.remove'),
|
||||||
|
event: 'remove',
|
||||||
|
icon: 'delete'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.queue-item.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
item() {
|
item() {
|
||||||
if (this.item?.data_kind === 'spotify') {
|
if (this.item?.data_kind === 'spotify') {
|
||||||
@ -164,7 +173,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
open_album() {
|
open_album() {
|
||||||
if (this.item.data_kind === 'spotify') {
|
if (this.item.data_kind === 'spotify') {
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@cancel="cancel"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@pair="pair"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<p class="title is-4" v-text="$t('dialog.remote-pairing.title')" />
|
<p class="title is-4" v-text="$t('dialog.remote-pairing.title')" />
|
||||||
<form @submit.prevent="kickoff_pairing">
|
<form @submit.prevent="pair">
|
||||||
<label class="label" v-text="pairing.remote" />
|
<label class="label" v-text="pairing.remote" />
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
@ -18,46 +24,46 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-danger" @click="$emit('close')">
|
|
||||||
<mdicon class="icon" name="cancel" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.remote-pairing.cancel')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item" @click="kickoff_pairing">
|
|
||||||
<mdicon class="icon" name="cellphone" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.remote-pairing.pair')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import { useRemotesStore } from '@/stores/remotes'
|
import { useRemotesStore } from '@/stores/remotes'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogRemotePairing',
|
name: 'ModalDialogRemotePairing',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { show: Boolean },
|
props: { show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
return { remoteStore: useRemotesStore() }
|
return { remoteStore: useRemotesStore() }
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pairing_req: { pin: '' }
|
pairing_req: { pin: '' }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.remote-pairing.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
icon: 'cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.remote-pairing.pair'),
|
||||||
|
event: 'pair',
|
||||||
|
icon: 'cellphone'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
pairing() {
|
pairing() {
|
||||||
return this.remoteStore.pairing
|
return this.remoteStore.pairing
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
show() {
|
show() {
|
||||||
if (this.show) {
|
if (this.show) {
|
||||||
@ -69,9 +75,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
kickoff_pairing() {
|
pair() {
|
||||||
webapi.pairing_kickoff(this.pairing_req).then(() => {
|
webapi.pairing_kickoff(this.pairing_req).then(() => {
|
||||||
this.pairing_req.pin = ''
|
this.pairing_req.pin = ''
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<p class="title is-4" v-text="item.title" />
|
<p class="title is-4" v-text="item.title" />
|
||||||
<p class="subtitle" v-text="item.artist" />
|
<p class="subtitle" v-text="item.artist" />
|
||||||
<div v-if="item.media_kind === 'podcast'" class="buttons">
|
<div v-if="item.media_kind === 'podcast'" class="buttons">
|
||||||
@ -150,45 +157,49 @@
|
|||||||
<div class="title is-6" v-text="item.comment" />
|
<div class="title is-6" v-text="item.comment" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.track.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.track.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.track.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import SpotifyWebApi from 'spotify-web-api-js'
|
import SpotifyWebApi from 'spotify-web-api-js'
|
||||||
import { useServicesStore } from '@/stores/services'
|
import { useServicesStore } from '@/stores/services'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogTrack',
|
name: 'ModalDialogTrack',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close', 'play-count-changed'],
|
emits: ['close', 'play-count-changed'],
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
return { servicesStore: useServicesStore() }
|
return { servicesStore: useServicesStore() }
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
spotify_track: {}
|
spotify_track: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.track.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.track.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.track.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
item() {
|
item() {
|
||||||
if (
|
if (
|
||||||
@ -208,7 +219,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
mark_new() {
|
mark_new() {
|
||||||
webapi
|
webapi
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog :show="show" @close="$emit('close')">
|
<modal-dialog-action
|
||||||
<template #content>
|
:actions="actions"
|
||||||
|
:show="show"
|
||||||
|
@add="queue_add"
|
||||||
|
@add-next="queue_add_next"
|
||||||
|
@close="$emit('close')"
|
||||||
|
@play="play"
|
||||||
|
>
|
||||||
|
<template #modal-content>
|
||||||
<p class="title is-4" v-text="item.name" />
|
<p class="title is-4" v-text="item.name" />
|
||||||
<p class="subtitle" v-text="item.artists[0].name" />
|
<p class="subtitle" v-text="item.artists[0].name" />
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
@ -59,33 +66,39 @@
|
|||||||
<div class="title is-6" v-text="item.uri" />
|
<div class="title is-6" v-text="item.uri" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
</modal-dialog-action>
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add">
|
|
||||||
<mdicon class="icon" name="playlist-plus" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.track.add')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="queue_add_next">
|
|
||||||
<mdicon class="icon" name="playlist-play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.track.add-next')" />
|
|
||||||
</a>
|
|
||||||
<a class="card-footer-item has-text-dark" @click="play">
|
|
||||||
<mdicon class="icon" name="play" size="16" />
|
|
||||||
<span class="is-size-7" v-text="$t('dialog.spotify.track.play')" />
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</modal-dialog>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ModalDialog from '@/components/ModalDialog.vue'
|
import ModalDialogAction from '@/components/ModalDialogAction.vue'
|
||||||
import webapi from '@/webapi'
|
import webapi from '@/webapi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ModalDialogTrackSpotify',
|
name: 'ModalDialogTrackSpotify',
|
||||||
components: { ModalDialog },
|
components: { ModalDialogAction },
|
||||||
props: { item: { required: true, type: Object }, show: Boolean },
|
props: { item: { required: true, type: Object }, show: Boolean },
|
||||||
emits: ['close'],
|
emits: ['close'],
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.track.add'),
|
||||||
|
event: 'add',
|
||||||
|
icon: 'playlist-plus'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.track.add-next'),
|
||||||
|
event: 'add-next',
|
||||||
|
icon: 'playlist-play'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.spotify.track.play'),
|
||||||
|
event: 'play',
|
||||||
|
icon: 'play'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open_album() {
|
open_album() {
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal-dialog-action
|
<modal-dialog-action
|
||||||
|
:actions="actions"
|
||||||
:show="show"
|
:show="show"
|
||||||
:title="$t('dialog.update.title')"
|
:title="$t('dialog.update.title')"
|
||||||
:ok_action="libraryStore.updating ? '' : $t('dialog.update.rescan')"
|
@analyse="update_library"
|
||||||
:close_action="$t('dialog.update.cancel')"
|
@cancel="close()"
|
||||||
@ok="update_library"
|
|
||||||
@close="close()"
|
|
||||||
>
|
>
|
||||||
<template #modal-content>
|
<template #modal-content>
|
||||||
<div v-if="!libraryStore.updating">
|
<div v-if="!libraryStore.updating">
|
||||||
@ -70,6 +69,22 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('dialog.update.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
icon: 'cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.libraryStore.updating
|
||||||
|
? 'In progress'
|
||||||
|
: this.$t('dialog.update.rescan'),
|
||||||
|
event: 'analyse',
|
||||||
|
icon: 'check'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
rss() {
|
rss() {
|
||||||
return this.libraryStore.rss
|
return this.libraryStore.rss
|
||||||
},
|
},
|
||||||
|
@ -47,12 +47,11 @@
|
|||||||
@remove-podcast="open_remove_podcast_dialog"
|
@remove-podcast="open_remove_podcast_dialog"
|
||||||
/>
|
/>
|
||||||
<modal-dialog-action
|
<modal-dialog-action
|
||||||
|
:actions="actions"
|
||||||
:show="show_remove_podcast_modal"
|
:show="show_remove_podcast_modal"
|
||||||
:title="$t('page.podcast.remove-podcast')"
|
:title="$t('page.podcast.remove-podcast')"
|
||||||
:close_action="$t('page.podcast.cancel')"
|
@cancel="show_remove_podcast_modal = false"
|
||||||
:delete_action="$t('page.podcast.remove')"
|
@remove="remove_podcast"
|
||||||
@close="show_remove_podcast_modal = false"
|
|
||||||
@delete="remove_podcast"
|
|
||||||
>
|
>
|
||||||
<template #modal-content>
|
<template #modal-content>
|
||||||
<i18n-t keypath="page.podcast.remove-info" tag="p" scope="global">
|
<i18n-t keypath="page.podcast.remove-info" tag="p" scope="global">
|
||||||
@ -118,7 +117,22 @@ export default {
|
|||||||
tracks: new GroupedList()
|
tracks: new GroupedList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
actions() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: this.$t('page.podcast.cancel'),
|
||||||
|
event: 'cancel',
|
||||||
|
icon: 'cancel'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: this.$t('page.podcast.remove'),
|
||||||
|
event: 'remove',
|
||||||
|
icon: 'delete'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open_remove_podcast_dialog() {
|
open_remove_podcast_dialog() {
|
||||||
webapi
|
webapi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user