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