import{l as R,v as D,m as H,H as X,f as r,C as x,d as S,ar as U,r as m,o as Y,b as n,n as j,c as f,g as C,i as e,w as i,X as $,t,F as V,h as z,u as d,j as M,e as B}from"./index-bf0eaf20.js";import{_ as E,e as q}from"./eventbus-b340f869.js";import{L as G}from"./ListItem-b1725b5d.js";import{C as I}from"./Container-88f21350.js";import{V as P}from"./VToolbar-219721ba.js";import{m as J,e as K,b as O,k as Q,c as W,w as A}from"./VListItem-223b492d.js";import"./Button-574f04d4.js";import"./_plugin-vue_export-helper-c27b6911.js";/* empty css              */const Z=R({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,...J(),...K(),...O(),...D()},"VTable"),ee=H()({name:"VTable",props:Z(),setup(s,h){let{slots:o,emit:y}=h;const{themeClasses:g}=X(s),{densityClasses:_}=Q(s);return W(()=>r(s.tag,{class:["v-table",{"v-table--fixed-height":!!s.height,"v-table--fixed-header":s.fixedHeader,"v-table--fixed-footer":s.fixedFooter,"v-table--has-top":!!o.top,"v-table--has-bottom":!!o.bottom,"v-table--hover":s.hover},g.value,_.value,s.class],style:s.style},{default:()=>{var c,v,b;return[(c=o.top)==null?void 0:c.call(o),o.default?r("div",{class:"v-table__wrapper",style:{height:x(s.height)}},[r("table",null,[o.default()])]):(v=o.wrapper)==null?void 0:v.call(o),(b=o.bottom)==null?void 0:b.call(o)]}})),{}}}),te={style:{"margin-bottom":"10px"}},ae={class:"line-clamp-1"},ne={class:"line-clamp-1"},oe={style:{"margin-bottom":"10px"}},le={key:0},se=["href"],ge=S({__name:"CoreConfigs",setup(s){const h=U(),o=m([]),y=m(0),g=m(0),_=m(0),c=m(0),v=m(0),b=function(a){h.push(`/settings/editcore/${a}`)},N=function(a){window.open(a,"_blank")},F=function(a,p){const k=[{label:"settings.configure",labelArgs:[],action:()=>{b(p.domain)},icon:"mdi-cog"},{label:"settings.documentation",labelArgs:[],action:()=>{N(n.providerManifests[p.domain].documentation)},icon:"mdi-bookshelf",disabled:!n.providerManifests[p.domain].documentation}];q.emit("contextmenu",{items:k,posX:a.clientX,posY:a.clientY})};return Y(async()=>{o.value=await n.getCoreConfigs(),y.value=(await n.getLibraryArtists(void 0,void 0,1)).total||0,g.value=(await n.getLibraryAlbums(void 0,void 0,1)).total||0,_.value=(await n.getLibraryTracks(void 0,void 0,1)).total||0,c.value=(await n.getLibraryPlaylists(void 0,void 0,1)).total||0,v.value=(await n.getLibraryRadios(void 0,void 0,1)).total||0}),(a,p)=>{const k=j("Button");return f(),C(V,null,[e("div",te,[r(P,{color:"transparent"},{title:i(()=>[$(t(a.$t("settings.core_modules")),1)]),_:1}),r(I,null,{default:i(()=>[(f(!0),C(V,null,z(o.value.sort((l,u)=>d(n).providerManifests[l.domain].name.localeCompare(d(n).providerManifests[u.domain].name)),l=>(f(),B(G,{key:l.domain,"show-menu-btn":"",class:"list-item-main",link:"",onMenu:u=>F(u,l),onClick:u=>b(l.domain)},{prepend:i(()=>[r(E,{domain:l.domain,size:40,class:"listitem-media-thumb",style:{"margin-left":"10px"}},null,8,["domain"])]),title:i(()=>[e("div",ae,t(d(n).providerManifests[l.domain].name),1)]),subtitle:i(()=>[e("div",ne,t(d(n).providerManifests[l.domain].description),1)]),append:i(()=>[l.last_error?(f(),B(k,{key:0,icon:"",title:l.last_error},{default:i(()=>[r(A,{color:"red"},{default:i(()=>[$(" mdi-alert-circle ")]),_:1})]),_:2},1032,["title"])):M("",!0)]),_:2},1032,["onMenu","onClick"]))),128))]),_:1})]),e("div",oe,[r(P,{color:"transparent"},{title:i(()=>[$(t(a.$t("settings.server_info")),1)]),_:1}),r(I,null,{default:i(()=>[r(ee,null,{default:i(()=>{var l,u,w,L,T;return[e("tbody",null,[e("tr",null,[e("td",null,t(a.$t("settings.server_id")),1),e("td",null,t((l=d(n).serverInfo.value)==null?void 0:l.server_id),1)]),e("tr",null,[e("td",null,t(a.$t("settings.server_version")),1),e("td",null,t((u=d(n).serverInfo.value)==null?void 0:u.server_version),1)]),(w=d(n).serverInfo.value)!=null&&w.homeassistant_addon?M("",!0):(f(),C("tr",le,[e("td",null,t(a.$t("settings.server_base_url")),1),e("td",null,t((L=d(n).serverInfo.value)==null?void 0:L.base_url),1)])),e("tr",null,[e("td",null,t(a.$t("settings.server_as_addon")),1),e("td",null,[r(A,{icon:(T=d(n).serverInfo.value)!=null&&T.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(y.value),1)]),e("tr",null,[e("td",null,t(a.$t("settings.albums_in_library")),1),e("td",null,t(g.value),1)]),e("tr",null,[e("td",null,t(a.$t("settings.tracks_in_library")),1),e("td",null,t(_.value),1)]),e("tr",null,[e("td",null,t(a.$t("settings.playlists_in_library")),1),e("td",null,t(c.value),1)]),e("tr",null,[e("td",null,t(a.$t("settings.radio_in_library")),1),e("td",null,t(v.value),1)]),e("tr",null,[e("td",null,t(a.$t("settings.server_logging")),1),e("td",null,[e("a",{href:`${d(n).baseUrl}/log`,target:"_blank"},t(a.$t("settings.download_log")),9,se)])])])]}),_:1})]),_:1})])],64)}}});export{ge as default};
