import{p as A,f as L,g as P,i as N,n as u,a as F,x as R,az as D,r as x,o as z,I as a,H as d,N as H,y as f,D as y,B as e,A as i,F as w,S as C,J as n,E as S,z as T,G as o,K as V}from"./index-CFvoaD7J.js";import{_ as E}from"./ProviderIcon.vue_vue_type_script_setup_true_lang-Ji67J6Pu.js";import{L as U}from"./ListItem-nYGtvGaY.js";import{C as B}from"./Container-BDz3QMuX.js";import{e as X}from"./eventbus-CGRXT3Tn.js";import{V as I}from"./VToolbar-Da4d1W_R.js";import{a as Y,o as q,d as G,q as J,i as K,w as M}from"./VListItem-CSPID7yq.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./VContainer-CzfHAKpA.js";/* empty css              */const j=A({fixedHeader:Boolean,fixedFooter:Boolean,height:[Number,String],hover:Boolean,...Y(),...q(),...G(),...L()},"VTable"),O=P()({name:"VTable",props:j(),setup(l,g){let{slots:s,emit:v}=g;const{themeClasses:_}=N(l),{densityClasses:p}=J(l);return K(()=>u(l.tag,{class:["v-table",{"v-table--fixed-height":!!l.height,"v-table--fixed-header":l.fixedHeader,"v-table--fixed-footer":l.fixedFooter,"v-table--has-top":!!s.top,"v-table--has-bottom":!!s.bottom,"v-table--hover":l.hover},_.value,p.value,l.class],style:l.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(l.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"],be=R({__name:"CoreConfigs",setup(l){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}];X.emit("contextmenu",{items:b,posX:t.clientX,posY:t.clientY})};return z(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=H("Button");return f(),y(w,null,[e("div",Q,[u(I,{color:"transparent"},{title:i(()=>[C(n(t.$t("settings.core_modules")),1)]),_:1}),u(B,null,{default:i(()=>[(f(!0),y(w,null,S(s.value.sort((r,c)=>o(a).providerManifests[r.domain].name.localeCompare(o(a).providerManifests[c.domain].name)),r=>(f(),T(U,{key:r.domain,"show-menu-btn":"",class:"list-item-main",link:"",onMenu:c=>p(c,r),onClick:c=>v(r.domain)},{prepend:i(()=>[u(E,{domain:r.domain,size:40,class:"listitem-media-thumb",style:{"margin-left":"10px"}},null,8,["domain"])]),title:i(()=>[e("div",W,n(o(a).providerManifests[r.domain].name),1)]),subtitle:i(()=>[e("div",Z,n(o(a).providerManifests[r.domain].description),1)]),append:i(()=>[r.last_error?(f(),T(b,{key:0,icon:"",title:r.last_error},{default:i(()=>[u(M,{color:"red"},{default:i(()=>m[0]||(m[0]=[C(" mdi-alert-circle ")])),_:1})]),_:2},1032,["title"])):V("",!0)]),_:2},1032,["onMenu","onClick"]))),128))]),_:1})]),e("div",ee,[u(I,{color:"transparent"},{title:i(()=>[C(n(t.$t("settings.server_info")),1)]),_:1}),u(B,null,{default:i(()=>[u(O,null,{default:i(()=>{var r,c,h,k,$;return[e("tbody",null,[e("tr",null,[e("td",null,n(t.$t("settings.server_id")),1),e("td",null,n((r=o(a).serverInfo.value)==null?void 0:r.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)]),(h=o(a).serverInfo.value)!=null&&h.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(M,{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{be as default};
