import{C}from"./Container-L7ytxuXf.js";import{L as B}from"./ListItem-DzMz1Zx0.js";import{g as M,p as V,G as L,d as I,n as A,o as u,q as P,r as N,v as R,x,B as z,C as D,E as e,s as F,aw as S,J as E,a3 as X,aN as s,av as d,ax as p,ay as c,aD as o,bf as y,aL as t,ag as h,aE as G,aB as l,az as k,aJ as $,aC as H,aX as J,aG as T,aT as U,cC as Y,aM as q}from"./index-BeguICWm.js";import{V as w}from"./VToolbar-DZP2Ylkv.js";import"./index-kQIztB-E.js";import"./Button-BjWxTVGU.js";const j=V({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,striped:{type:String,default:null,validator:n=>["even","odd"].includes(n)},...D(),...z(),...x(),...R()},"VTable"),K=M()({name:"VTable",props:j(),setup(n,v){let{slots:r,emit:g}=v;const{themeClasses:f}=L(n),{densityClasses:a}=I(n);return A(()=>u(n.tag,{class:N(["v-table",{"v-table--fixed-height":!!n.height,"v-table--fixed-header":n.fixedHeader,"v-table--fixed-footer":n.fixedFooter,"v-table--has-top":!!r.top,"v-table--has-bottom":!!r.bottom,"v-table--hover":n.hover,"v-table--striped-even":n.striped==="even","v-table--striped-odd":n.striped==="odd"},f.value,a.value,n.class]),style:P(n.style)},{default:()=>[r.top?.(),r.default?e("div",{class:"v-table__wrapper",style:{height:F(n.height)}},[e("table",null,[r.default()])]):r.wrapper?.(),r.bottom?.()]})),{}}}),O={style:{"margin-bottom":"10px"}},Q={class:"line-clamp-1"},W={class:"line-clamp-1"},Z={style:{"margin-bottom":"10px"}},ee={key:0},te=["href"],ie=S({__name:"CoreConfigs",setup(n){const v=H(),r=E([]),g=function(a){v.push(`/settings/editcore/${a}`)},f=function(a,m){const _=[{label:"settings.configure",labelArgs:[],action:()=>{g(m.domain)},icon:"mdi-cog"},{label:"settings.documentation",labelArgs:[],action:()=>{Y(s.providerManifests[m.domain].documentation)},icon:"mdi-bookshelf",disabled:!s.providerManifests[m.domain].documentation}];q.emit("contextmenu",{items:_,posX:a.clientX,posY:a.clientY})};return X(async()=>{r.value=await s.getCoreConfigs(),d.libraryArtistsCount=await s.getLibraryArtistsCount(),d.libraryAlbumsCount=await s.getLibraryAlbumsCount(),d.libraryTracksCount=await s.getLibraryTracksCount(),d.libraryPlaylistsCount=await s.getLibraryPlaylistsCount(),d.libraryRadiosCount=await s.getLibraryRadiosCount()}),(a,m)=>{const _=J("Button");return c(),p(h,null,[e("div",O,[u(w,{color:"transparent"},{title:o(()=>[y(t(a.$t("settings.core_modules")),1)]),_:1}),u(C,null,{default:o(()=>[(c(!0),p(h,null,G(r.value.sort((i,b)=>l(s).providerManifests[i.domain].name.localeCompare(l(s).providerManifests[b.domain].name)),i=>(c(),T(B,{key:i.domain,"show-menu-btn":"",class:"list-item-main",link:"",onMenu:b=>f(b,i),onClick:b=>g(i.domain)},{prepend:o(()=>[u(U,{domain:i.domain,size:40,class:"listitem-media-thumb",style:{"margin-left":"10px"}},null,8,["domain"])]),title:o(()=>[e("div",Q,t(l(s).providerManifests[i.domain].name),1)]),subtitle:o(()=>[e("div",W,t(l(s).providerManifests[i.domain].description),1)]),append:o(()=>[i.last_error?(c(),T(_,{key:0,icon:"",title:i.last_error},{default:o(()=>[u($,{color:"red"},{default:o(()=>[...m[0]||(m[0]=[y(" mdi-alert-circle ",-1)])]),_:1})]),_:1},8,["title"])):k("",!0)]),_:2},1032,["onMenu","onClick"]))),128))]),_:1})]),e("div",Z,[u(w,{color:"transparent"},{title:o(()=>[y(t(a.$t("settings.server_info")),1)]),_:1}),u(C,null,{default:o(()=>[u(K,null,{default:o(()=>[e("tbody",null,[e("tr",null,[e("td",null,t(a.$t("settings.server_id")),1),e("td",null,t(l(s).serverInfo.value?.server_id),1)]),e("tr",null,[e("td",null,t(a.$t("settings.server_version")),1),e("td",null,t(l(s).serverInfo.value?.server_version),1)]),l(s).serverInfo.value?.homeassistant_addon?k("",!0):(c(),p("tr",ee,[e("td",null,t(a.$t("settings.server_base_url")),1),e("td",null,t(l(s).serverInfo.value?.base_url),1)])),e("tr",null,[e("td",null,t(a.$t("settings.server_as_addon")),1),e("td",null,[u($,{icon:l(s).serverInfo.value?.homeassistant_addon?"mdi-check":"mdi-close"},null,8,["icon"])])]),e("tr",null,[e("td",null,t(a.$t("settings.artists_in_library")),1),e("td",null,t(l(d).libraryArtistsCount),1)]),e("tr",null,[e("td",null,t(a.$t("settings.albums_in_library")),1),e("td",null,t(l(d).libraryAlbumsCount),1)]),e("tr",null,[e("td",null,t(a.$t("settings.tracks_in_library")),1),e("td",null,t(l(d).libraryTracksCount),1)]),e("tr",null,[e("td",null,t(a.$t("settings.playlists_in_library")),1),e("td",null,t(l(d).libraryPlaylistsCount),1)]),e("tr",null,[e("td",null,t(a.$t("settings.radio_in_library")),1),e("td",null,t(l(d).libraryRadiosCount),1)]),e("tr",null,[e("td",null,t(a.$t("settings.server_logging")),1),e("td",null,[e("a",{href:`${l(s).baseUrl}/music-assistant.log`,target:"_blank"},t(a.$t("settings.download_log")),9,te)])])])]),_:1})]),_:1})])],64)}}});export{ie as default};
