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