forked from owntone/owntone-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModalDialogDirectory.vue
87 lines (79 loc) · 2.48 KB
/
ModalDialogDirectory.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<template>
<div>
<transition name="fade">
<div v-if="show" class="modal is-active">
<div class="modal-background" @click="$emit('close')" />
<div class="modal-content fd-modal-card">
<div class="card">
<div class="card-content">
<p class="title is-4">
{{ directory.path }}
</p>
</div>
<footer class="card-footer">
<a class="card-footer-item has-text-dark" @click="queue_add">
<span class="icon"
><mdicon name="playlist-plus" size="16"
/></span>
<span class="is-size-7">Add</span>
</a>
<a class="card-footer-item has-text-dark" @click="queue_add_next">
<span class="icon"
><mdicon name="playlist-play" size="16"
/></span>
<span class="is-size-7">Add Next</span>
</a>
<a class="card-footer-item has-text-dark" @click="play">
<span class="icon"><mdicon name="play" size="16" /></span>
<span class="is-size-7">Play</span>
</a>
<a class="card-footer-item has-text-dark" @click="update_rescan">
<span class="icon"><mdicon name="harddisk" size="16" /></span>
<span class="is-size-7">Update/Rescan</span>
</a>
</footer>
</div>
</div>
<button
class="modal-close is-large"
aria-label="close"
@click="$emit('close')"
/>
</div>
</transition>
</div>
</template>
<script>
import webapi from '@/webapi'
export default {
name: 'ModalDialogDirectory',
props: ['show', 'directory'],
emits: ['close'],
methods: {
play: function () {
this.$emit('close')
webapi.player_play_expression(
'path starts with "' + this.directory.path + '" order by path asc',
false
)
},
update_rescan: function () {
this.$emit('close')
webapi.library_update_path(this.directory.path)
},
queue_add: function () {
this.$emit('close')
webapi.queue_expression_add(
'path starts with "' + this.directory.path + '" order by path asc'
)
},
queue_add_next: function () {
this.$emit('close')
webapi.queue_expression_add_next(
'path starts with "' + this.directory.path + '" order by path asc'
)
}
}
}
</script>
<style></style>