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