import{d as R,M as T,U as B,f as N,g as s,p as U,I,am as M,ao as Y,c as k,j as l,a as m,l as i,o as d,n as t,u as o,bW as $,bf as A,bX as w,ax as D,bY as V,bZ as j,A as q}from"./index-bJiZR03d.js";import{u as F}from"./usePageTitle-wT6f1BZv.js";const X=R({__name:"WorkPool",setup(O){const b=T(),n=B("workPoolName"),f={interval:3e5},u=N(b.workPools.getWorkPoolByName,[n.value],f),e=s(()=>u.response),p=s(()=>{var a;return((a=e.value)==null?void 0:a.type)==="prefect-agent"}),v=s(()=>[{label:"Details",hidden:U.xl},{label:"Runs"},{label:"Work Queues"},{label:"Workers",hidden:p.value}]),r=I("tab","Details"),{tabs:_}=M(v,r),P=s(()=>{var a;return((a=e.value)==null?void 0:a.status)!=="ready"}),y=s(()=>{var a;return`prefect ${p.value?"agent":"worker"} start --pool "${(a=e.value)==null?void 0:a.name}"`}),{filter:W}=Y({workPools:{name:[n.value]}}),g=s(()=>e.value?`Work Pool: ${e.value.name}`:"Work Pool");return F(g),(a,c)=>{const x=i("p-tabs"),C=i("p-layout-well");return e.value?(d(),k(C,{key:0,class:"work-pool"},{header:l(()=>[t(o($),{"work-pool":e.value,onUpdate:o(u).refresh},null,8,["work-pool","onUpdate"]),P.value?(d(),k(o(A),{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:l(()=>[t(o(w),{alternate:"","work-pool":e.value},null,8,["work-pool"])]),default:l(()=>[t(x,{selected:o(r),"onUpdate:selected":c[0]||(c[0]=h=>q(r)?r.value=h:null),tabs:o(_)},{details:l(()=>[t(o(w),{"work-pool":e.value},null,8,["work-pool"])]),runs:l(()=>[t(o(D),{filter:o(W),prefix:"runs"},null,8,["filter"])]),"work-queues":l(()=>[t(o(V),{"work-pool-name":o(n)},null,8,["work-pool-name"])]),workers:l(()=>[t(o(j),{"work-pool-name":o(n)},null,8,["work-pool-name"])]),_:1},8,["selected","tabs"])]),_:1})):m("",!0)}}});export{X as default};
