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