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