import{d as $,a as M,M as O,E as T,c as t,j as U,R as D,ah as E,aG as S,b as u,e as k,w as l,f as d,o as m,h as a,u as e,bM as V,bN as w,aL as Y,bO as j,bP as q,s as z}from"./index-562c8470.js";import{u as A}from"./usePageTitle-ad3dbf10.js";const Q=$({__name:"WorkPool",setup(F){const f=M(),r=O("workPoolName"),v={interval:3e5},c=T(f.workPools.getWorkPoolByName,[r.value],v),o=t(()=>c.response),p=t(()=>{var n;return((n=o.value)==null?void 0:n.type)==="prefect-agent"}),_=t(()=>[{label:"Details",hidden:U.xl},{label:"Runs"},{label:"Work Queues"},{label:"Workers",hidden:p.value}]),s=D("tab","Details"),{tabs:b}=E(_,s),P=t(()=>o.value?`Your work pool ${o.value.name} is ready to go!`:"Your work pool is ready to go!"),g=t(()=>{var n;return`prefect ${p.value?"agent":"worker"} start --pool "${(n=o.value)==null?void 0:n.name}"`}),y=t(()=>`Work pools organize work that ${p.value?"Prefect agents":"Prefect workers"} can pull from.`),{filter:W}=S({workPools:{name:[r.value]}}),h=t(()=>o.value?`Work Pool: ${o.value.name}`:"Work Pool");return A(h),(n,i)=>{const B=u("CodeBanner"),C=u("p-tabs"),x=u("p-layout-well"),N=u("p-layout-default");return o.value?(m(),k(N,{key:0},{header:l(()=>[a(e(V),{"work-pool":o.value,onUpdate:e(c).refresh},null,8,["work-pool","onUpdate"])]),default:l(()=>[o.value?(m(),k(x,{key:0,class:"work-pool"},{header:l(()=>[a(B,{command:g.value,title:P.value,subtitle:y.value},null,8,["command","title","subtitle"])]),well:l(()=>[a(e(w),{alternate:"","work-pool":o.value},null,8,["work-pool"])]),default:l(()=>[a(C,{selected:e(s),"onUpdate:selected":i[0]||(i[0]=R=>z(s)?s.value=R:null),tabs:e(b)},{details:l(()=>[a(e(w),{"work-pool":o.value},null,8,["work-pool"])]),runs:l(()=>[a(e(Y),{"flow-run-filter":e(W)},null,8,["flow-run-filter"])]),"work-queues":l(()=>[a(e(j),{"work-pool-name":e(r)},null,8,["work-pool-name"])]),workers:l(()=>[a(e(q),{"work-pool-name":e(r)},null,8,["work-pool-name"])]),_:1},8,["selected","tabs"])]),_:1})):d("",!0)]),_:1})):d("",!0)}}});export{Q as default};
