import{p as L,n as A,k as P,G as N,f as u,B as F,d as R,ak as D,r as x,o as H,b as a,s as d,l as S,c as f,h as y,g as e,w as i,F as w,W as h,t as n,i as U,e as T,u as o,j as V}from"./index-CLKg64ON.js";import{_ as X,e as Y}from"./eventbus-D-xzWv8v.js";import{L as j}from"./ListItem-f79Nhqh7.js";import{C as B}from"./Container-ZPskS02H.js";import{V as M}from"./VToolbar-DSn0RyUD.js";import{m as z,e as E,b as G,k as W,c as q,w as I}from"./VListItem-B_TSjQ1y.js";import"./Button-F8l3l_P8.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";/* empty css              */const J=L({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,...z(),...E(),...G(),...A()},"VTable"),K=P()({name:"VTable",props:J(),setup(r,g){let{slots:s,emit:v}=g;const{themeClasses:_}=N(r),{densityClasses:p}=W(r);return q(()=>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)]}})),{}}}),O={style:{"margin-bottom":"10px"}},Q={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=x([]),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}];Y.emit("contextmenu",{items:b,posX:t.clientX,posY:t.clientY})};return H(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=S("Button");return f(),y(w,null,[e("div",O,[u(M,{color:"transparent"},{title:i(()=>[h(n(t.$t("settings.core_modules")),1)]),_:1}),u(B,null,{default:i(()=>[(f(!0),y(w,null,U(s.value.sort((l,c)=>o(a).providerManifests[l.domain].name.localeCompare(o(a).providerManifests[c.domain].name)),l=>(f(),T(j,{key:l.domain,"show-menu-btn":"",class:"list-item-main",link:"",onMenu:c=>p(c,l),onClick:c=>v(l.domain)},{prepend:i(()=>[u(X,{domain:l.domain,size:40,class:"listitem-media-thumb",style:{"margin-left":"10px"}},null,8,["domain"])]),title:i(()=>[e("div",Q,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(),T(b,{key:0,icon:"",title:l.last_error},{default:i(()=>[u(I,{color:"red"},{default:i(()=>m[0]||(m[0]=[h(" mdi-alert-circle ")])),_:1})]),_:2},1032,["title"])):V("",!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(B,null,{default:i(()=>[u(K,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?V("",!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(I,{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};
