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