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