import{d as R,D as g,b as D,Y as N,e as s,m as T,B as Y,al as U,an as V,c as k,h as l,a as m,i,o as d,k as t,u as o,bV as $,be as A,bW as w,aw as S,bX as q,bY as F,v as H}from"./index-WCZ_4nWW.js";import{u as I}from"./usePageTitle-Y7n4a-YH.js";const X=R({__name:"WorkPool",setup(L){const b=g(),n=D("workPoolName"),v={interval:3e5},u=N(b.workPools.getWorkPoolByName,[n.value],v),e=s(()=>u.response),p=s(()=>{var a;return((a=e.value)==null?void 0:a.type)==="prefect-agent"}),f=s(()=>[{label:"Details",hidden:T.xl},{label:"Runs"},{label:"Work Queues"},{label:"Workers",hidden:p.value}]),r=Y("tab","Details"),{tabs:_}=U(f,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}=V({workPools:{name:[n.value]}}),h=s(()=>e.value?`Work Pool: ${e.value.name}`:"Work Pool");return I(h),(a,c)=>{const B=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(B,{selected:o(r),"onUpdate:selected":c[0]||(c[0]=x=>H(r)?r.value=x:null),tabs:o(_)},{details:l(()=>[t(o(w),{"work-pool":e.value},null,8,["work-pool"])]),runs:l(()=>[t(o(S),{filter:o(W),prefix:"runs"},null,8,["filter"])]),"work-queues":l(()=>[t(o(q),{"work-pool-name":o(n)},null,8,["work-pool-name"])]),workers:l(()=>[t(o(F),{"work-pool-name":o(n)},null,8,["work-pool-name"])]),_:1},8,["selected","tabs"])]),_:1})):m("",!0)}}});export{X as default};
