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