import{d as S,m as E,E as T,bv as U,R as V,c as t,S as z,k as A,ap as O,a as s,f as m,w as a,h as i,o as w,n as l,g as e,bw as Q,bx as d,au as Y,by as j,bz as q,v as D}from"./index-18beffd6.js";import{u as F}from"./usePageTitle-5c97edcb.js";const J=S({__name:"WorkPool",setup(G){const f=E(),r=T("workPoolName"),v=U(),_={interval:3e5},p=V(f.workPools.getWorkPoolByName,[r.value],_),o=t(()=>p.response),u=t(()=>{var n;return((n=o.value)==null?void 0:n.type)==="prefect-agent"}),b=t(()=>[{label:"Details",hidden:z.xl},{label:"Runs"},{label:"Work Queues"},{label:"Workers",hidden:!v.access.workers||u.value}]),{tab:c,tabs:P}=A(b),y=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 ${u.value?"agent":"worker"} start --pool ${(n=o.value)==null?void 0:n.name}`}),B=t(()=>`Work pools organize work that ${u.value?"Prefect agents":"Prefect workers"} can pull from.`),{filter:C}=O({workPools:{name:[r.value]}}),W=t(()=>o.value?`Work Pool: ${o.value.name}`:"Work Pool");return F(W),(n,k)=>{const h=s("CodeBanner"),x=s("p-tabs"),N=s("p-layout-well"),R=s("p-layout-default");return o.value?(w(),m(R,{key:0},{header:a(()=>[l(e(Q),{"work-pool":o.value,onUpdate:e(p).refresh},null,8,["work-pool","onUpdate"])]),default:a(()=>[o.value?(w(),m(N,{key:0,class:"work-pool"},{header:a(()=>[l(h,{command:g.value,title:y.value,subtitle:B.value},null,8,["command","title","subtitle"])]),well:a(()=>[l(e(d),{alternate:"","work-pool":o.value},null,8,["work-pool"])]),default:a(()=>[l(x,{selected:e(c),"onUpdate:selected":k[0]||(k[0]=$=>D(c)?c.value=$:null),tabs:e(P)},{details:a(()=>[l(e(d),{"work-pool":o.value},null,8,["work-pool"])]),runs:a(()=>[l(e(Y),{"flow-run-filter":e(C)},null,8,["flow-run-filter"])]),"work-queues":a(()=>[l(e(j),{"work-pool-name":e(r)},null,8,["work-pool-name"])]),workers:a(()=>[l(e(q),{"work-pool-name":e(r)},null,8,["work-pool-name"])]),_:1},8,["selected","tabs"])]),_:1})):i("",!0)]),_:1})):i("",!0)}}});export{J as default};
