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