import{b as M,g as c,i as d,u as h,j as s,q as a,a4 as P,p as g,G as N,F as V,J as D,D as r,a as m,E as G,k as L}from"./vue-Cm77DuTi.js";import{u as T}from"./widget-jbnupkVY.js";import{M as U}from"./MkContainer-CNBcUt5w.js";import{_ as q}from"./MkMiniChart.vue_vue_type_script_setup_true_lang-p7s6jgEI.js";import{Q as E,b as F,d as H,T as $,V as _,_ as j}from"./app-QjDgb7aF.js";import"./v4-Dnyct6Ft.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const A={class:"wbrkwalb"},J=["src"],Q={class:"body"},S=["href","title"],w="federation",W=M({__name:"federation",props:{widget:{},foldable:{type:Boolean},scrollable:{type:Boolean}},emits:["updateProps"],setup(n,{expose:b,emit:v}){const k={showHeader:{type:"boolean",default:!0}},l=n,y=v,{widgetProps:x,configure:B}=T(w,k,l,y),p=m([]),u=m([]),f=m(!0);E(async()=>{const e=await H("federation/instances",{sort:"+lastCommunicatedAt",limit:5}),o=await Promise.all(e.map(i=>$("charts/instance",{host:i.host,limit:16,span:"hour"})));p.value=e,u.value=o,f.value=!1},1e3*60,{immediate:!0,afterMounted:!0});function C(e){return _(e.iconUrl,"preview")??_(e.faviconUrl,"preview")??"/client-assets/dummy.png"}return b({name:w,configure:B,id:l.widget?l.widget.id:null}),(e,o)=>{const i=G("MkLoading");return s(),c(U,{"show-header":h(x).showHeader,foldable:n.foldable,scrollable:n.scrollable,class:"mkw-federation"},{header:d(()=>[o[0]||(o[0]=a("i",{class:"ph-planet ph-bold ph-lg"},null,-1)),D(r(h(F).ts._widgets.federation),1)]),default:d(()=>[a("div",A,[f.value?(s(),c(i,{key:0})):(s(),c(P,{key:1,tag:"div",name:e.$store.state.animation?"chart":"",class:"instances"},{default:d(()=>[(s(!0),g(V,null,N(p.value,(t,I)=>(s(),g("div",{key:t.id,class:"instance"},[a("img",{src:C(t),alt:""},null,8,J),a("div",Q,[a("a",{class:"a",href:"https://"+t.host,target:"_blank",title:t.host},r(t.host),9,S),a("p",null,r(t.softwareName||"?")+" "+r(t.softwareVersion),1)]),L(q,{class:"chart",src:u.value[I].requests.received},null,8,["src"])]))),128))]),_:1},8,["name"]))])]),_:1},8,["show-header","foldable","scrollable"])}}}),ae=j(W,[["__scopeId","data-v-5e601e52"]]);export{ae as default};
//# sourceMappingURL=federation-BvB8ibvP.js.map
