mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
2 lines
6.5 KiB
JavaScript
2 lines
6.5 KiB
JavaScript
|
import{C as z}from"./ContentWithHeading.js";import{G as m}from"./GroupByList.js";import{_ as $,e as y,r as c,o as u,c as p,d as r,w as g,a as s,t as _,k as w,T as L,z as D,F as C,f as B,h as F,g as O,B as P}from"./index.js";import{L as T}from"./ListPlaylists.js";import{L as I}from"./ListTracks.js";import"./ModalDialogPlaylist.js";import"./spotify-web-api.js";const M={name:"ModalDialogDirectory",props:["show","directory"],emits:["close"],methods:{play(){this.$emit("close"),y.player_play_expression(`path starts with "${this.directory}" order by path asc`,!1)},queue_add(){this.$emit("close"),y.queue_expression_add(`path starts with "${this.directory}" order by path asc`)},queue_add_next(){this.$emit("close"),y.queue_expression_add_next(`path starts with "${this.directory}" order by path asc`)}}},N={key:0,class:"modal is-active"},V={class:"modal-content fd-modal-card"},E={class:"card"},G={class:"card-content"},R=["textContent"],S={class:"card-footer"},j=["textContent"],H=["textContent"],U=["textContent"];function W(t,e,n,h,o,i){const l=c("mdicon");return u(),p("div",null,[r(L,{name:"fade"},{default:g(()=>[n.show?(u(),p("div",N,[s("div",{class:"modal-background",onClick:e[0]||(e[0]=a=>t.$emit("close"))}),s("div",V,[s("div",E,[s("div",G,[s("p",{class:"title is-4",textContent:_(n.directory)},null,8,R)]),s("footer",S,[s("a",{class:"card-footer-item has-text-dark",onClick:e[1]||(e[1]=(...a)=>i.queue_add&&i.queue_add(...a))},[r(l,{class:"icon",name:"playlist-plus",size:"16"}),s("span",{class:"is-size-7",textContent:_(t.$t("dialog.directory.add"))},null,8,j)]),s("a",{class:"card-footer-item has-text-dark",onClick:e[2]||(e[2]=(...a)=>i.queue_add_next&&i.queue_add_next(...a))},[r(l,{class:"icon",name:"playlist-play",size:"16"}),s("span",{class:"is-size-7",textContent:_(t.$t("dialog.directory.add-next"))},null,8,H)]),s("a",{class:"card-footer-item has-text-dark",onClick:e[3]||(e[3]=(...a)=>i.play&&i.play(...a))},[r(l,{class:"icon",name:"play",size:"16"}),s("span",{class:"is-size-7",textContent:_(t.$t("dialog.directory.play"))},null,8,U)])])])]),s("button",{class:"modal-close is-large","aria-label":"close",onClick:e[4]||(e[4]=a=>t.$emit("close"))})])):w("",!0)]),_:1})])}const b=$(M,[["render",W]]),A={name:"ListDirectories",components:{ModalDialogDirectory:b},props:["directories"],data(){return{show_details_modal:!1,selected_directory:""}},computed:{current_directory(){return this.$route.query&&this.$route.query.directory?this.$route.query.directory:"/"}},methods:{open_parent_directory(){this.current_directory.slice(0,this.current_directory.lastIndexOf("/"))===""||this.$store.state.config.directories.includes(this.current_directory)?this.$router.push({name:"files"}):this.$router.push({name:"files",query:{directory:this.current_directory.slice(0,this.current_directory.lastIndexOf("/"))}})},open_directory(t){this.$router.push({name:"files",query:{directory:t.path}})},open_dialog(t){this.selected_directory=t.path,this.show_details_modal=!0}}},J={class:"media-left is-clickable"},K=s("div",{class:"media-content is-clickable is-clipped"},[s("h1",{class:"title is-6"},"..")],-1),Q={class:"media-right"},X=["onClick"],Y={class:"media-left is-clickable"},Z={class:"media-content is-clickable is-clipped"},tt=["textContent"],et=["textContent"],st={class:"media-right"},it=["onClick"];function ot(t,e,n,h,o,i){const l=c("mdicon"),a=c("modal-dialog-directory");return u(),p(C,null,[t.$route.query.directory?(u(),p("div",{key:0,class:"media is-align-items-center",onClick:e[0]||(e[0]=d=>i.open_parent_directory())},[s("figure",J,[r(l,{class:"icon",name:"subdirectory-arrow-left",size:"16"})]),K,s("div",Q,[D(t.$slots,"actions")])])):w("",!0),(u(!0),p(C,null,B(n.directories,d=>(u(),p("div",{key:d.path,class:"media is-align-items-center",onClick:k=>i.open_directory(d)},[s("figure",Y,[r(l,{class:"icon",name:"folder",size:"16"})]),s("div",Z,[s("h1",{class:"title is-6",textContent:_(d.path.substring(d.path.lastIndexOf("/")+1))},null,8,tt),s("h2",{class:"subtitle is-7 has-text-grey-light",textContent:_(d.path)},null,8,et)]),s("div",st,[s("a",{onClick:F(k=>i.open_dia
|