import{d as N,g as $,W as D,e as R,f as s,al as I,bt as U,bu as V,bS as Z,c as i,i as a,a as m,j as k,aL as j,o as d,k as t,l as e,c_ as F,c$ as S,d0 as w,bD as T,d1 as q,d2 as A,bV as L,a6 as O}from"./index-BBlvj0M_.js";import{u as Q}from"./usePageTitle-lBdMRcrQ.js";const G=N({__name:"WorkPool",setup(Y){const b=$(),n=D("workPoolName"),f={interval:3e5},u=R(b.workPools.getWorkPoolByName,[n.value],f),o=s(()=>u.response),p=s(()=>{var l;return((l=o.value)==null?void 0:l.type)==="prefect-agent"}),v=s(()=>[{label:"Details",hidden:j.xl},{label:"Runs"},{label:"Work Queues"},{label:"Workers",hidden:p.value},{label:"Deployments"}]),r=I("tab","Details"),{tabs:_}=U(v,r),P=s(()=>{var l;return((l=o.value)==null?void 0:l.status)!=="ready"}),y=s(()=>{var l;return`prefect ${p.value?"agent":"worker"} start --pool "${(l=o.value)==null?void 0:l.name}"`}),{filter:W}=V({workPools:{name:[n.value]}}),{filter:g}=Z({workPools:{name:[n.value]}}),C=s(()=>o.value?`Work Pool: ${o.value.name}`:"Work Pool");return Q(C),(l,c)=>{const h=k("p-tabs"),x=k("p-layout-well");return o.value?(d(),i(x,{key:0,class:"work-pool"},{header:a(()=>[t(e(F),{"work-pool":o.value,onUpdate:e(u).refresh},null,8,["work-pool","onUpdate"]),P.value?(d(),i(e(S),{key:0,class:"work-pool__code-banner",command:y.value,title:"Your work pool is almost ready!",subtitle:"Run this command to start."},null,8,["command"])):m("",!0)]),well:a(()=>[t(e(w),{alternate:"","work-pool":o.value},null,8,["work-pool"])]),default:a(()=>[t(h,{selected:e(r),"onUpdate:selected":c[0]||(c[0]=B=>O(r)?r.value=B:null),tabs:e(_)},{details:a(()=>[t(e(w),{"work-pool":o.value},null,8,["work-pool"])]),runs:a(()=>[t(e(T),{filter:e(W),prefix:"runs"},null,8,["filter"])]),"work-queues":a(()=>[t(e(q),{"work-pool-name":e(n)},null,8,["work-pool-name"])]),workers:a(()=>[t(e(A),{"work-pool-name":e(n)},null,8,["work-pool-name"])]),deployments:a(()=>[t(e(L),{filter:e(g)},null,8,["filter"])]),_:1},8,["selected","tabs"])]),_:1})):m("",!0)}}});export{G as default};
//# sourceMappingURL=WorkPool-0sOB16fD.js.map
