import{d as T,D,b as d,e as o,Y as v,an as S,m as U,B as Y,al as A,c as V,h as a,a as F,i as p,o as I,k as u,u as e,c4 as L,be as O,c5 as f,v as j,c6 as z,aw as E}from"./index-WCZ_4nWW.js";import{u as G}from"./usePageTitle-Y7n4a-YH.js";const M=T({__name:"WorkPoolQueue",setup(H){const c=D(),l=d("workPoolName"),P=o(()=>[l.value]),r=d("workPoolQueueName"),_=o(()=>[r.value]),k={interval:3e5},i=v(c.workPoolQueues.getWorkPoolQueueByName,[l.value,r.value],k),t=o(()=>i.response),b=v(c.workPools.getWorkPoolByName,[l.value],k),q=o(()=>b.response),w=o(()=>{var n;return((n=q.value)==null?void 0:n.type)==="prefect-agent"}),g=o(()=>t.value?`Your work pool ${t.value.name} is ready to go!`:"Your work queue is ready to go!"),Q=o(()=>`prefect ${w.value?"agent":"worker"} start --pool "${l.value}" --work-queue "${r.value}"`),y=o(()=>`Work queues are scoped to a work pool to allow ${w.value?"agents":"workers"} to pull from groups of queues with different priorities.`),{filter:N}=S({workPoolQueues:{name:_},workPools:{name:P}}),B=o(()=>[{label:"Details",hidden:U.xl},{label:"Upcoming Runs"},{label:"Runs"}]),s=Y("tab","Details"),{tabs:W}=A(B,s),h=o(()=>r.value?`Work Pool Queue: ${r.value}`:"Work Pool Queue");return G(h),(n,m)=>{const x=p("p-tabs"),C=p("p-layout-well"),R=p("p-layout-default");return t.value?(I(),V(R,{key:0,class:"work-pool-queue"},{header:a(()=>[u(e(L),{"work-pool-queue":t.value,"work-pool-name":e(l),onUpdate:e(i).refresh},null,8,["work-pool-queue","work-pool-name","onUpdate"])]),default:a(()=>[u(C,{class:"work-pool-queue__body"},{header:a(()=>[u(e(O),{command:Q.value,title:g.value,subtitle:y.value},null,8,["command","title","subtitle"])]),well:a(()=>[u(e(f),{alternate:"","work-pool-name":e(l),"work-pool-queue":t.value},null,8,["work-pool-name","work-pool-queue"])]),default:a(()=>[u(x,{selected:e(s),"onUpdate:selected":m[0]||(m[0]=$=>j(s)?s.value=$:null),tabs:e(W)},{details:a(()=>[u(e(f),{"work-pool-name":e(l),"work-pool-queue":t.value},null,8,["work-pool-name","work-pool-queue"])]),"upcoming-runs":a(()=>[u(e(z),{"work-pool-name":e(l),"work-pool-queue":t.value},null,8,["work-pool-name","work-pool-queue"])]),runs:a(()=>[u(e(E),{filter:e(N),prefix:"runs"},null,8,["filter"])]),_:1},8,["selected","tabs"])]),_:1})]),_:1})):F("",!0)}}});export{M as default};
