import{a as P,x as z,$ as d,c as r,r as k,P as E,z as O,f as o,w as i,g as h,B as $,o as s,j as u,u as e,E as j,i as F,G,F as C,H as I,D as b,K,h as f,L as m,N as Q,O as W,Q as X,R as q,S as J,U as M,V as Y,W as Z,n as ee,X as se}from"./index-e7fdb3d4.js";import{u as te}from"./usePageTitle-df55e3a5.js";const oe={class:"flow-runs__list"},ne={class:"flow-runs__list-controls"},le={class:"flow-runs__list-controls--right"},de=P({__name:"FlowRuns",setup(ue){const g=$(),c=z(),_=d(c.flowRuns.getFlowRunsCount,[{}]),x=r(()=>_.executed),V=r(()=>_.response===0),p=k(),S=E(p,1200),{filter:t,isCustomFilter:B}=O({flowRuns:{nameLike:S}}),w={interval:3e4},R=d(c.flowRuns.getFlowRunsCount,[t],w),N=r(()=>R.response),L=d(c.ui.getFlowRunHistory,[t],w),T=r(()=>L.response??[]),y=d(c.flowRuns.getFlowRuns,[t],w),v=r(()=>y.response??[]),n=k([]);function D(){g.push(se.flowRuns())}const H=()=>{n.value=[],y.refresh(),R.refresh()};return te("Flow Runs"),(ae,l)=>{const U=h("p-button"),A=h("p-layout-default");return s(),o(A,{class:"flow-runs"},{header:i(()=>[u(e(j))]),default:i(()=>[e(x)?(s(),F(C,{key:0},[e(V)?(s(),o(e(G),{key:0})):(s(),F(C,{key:1},[u(e(I)),e(b).md?(s(),o(e(K),{key:0,history:e(T),"start-date":e(t).flowRuns.expectedStartTimeAfter,"end-date":e(t).flowRuns.expectedStartTimeBefore,class:"flow-runs__chart"},null,8,["history","start-date","end-date"])):f("",!0),m("div",oe,[m("div",ne,[m("div",le,[n.value.length==0?(s(),o(e(Q),{key:0,count:e(N),label:"Flow run"},null,8,["count"])):(s(),o(e(W),{key:1,count:n.value.length},null,8,["count"])),u(e(X),{selected:n.value,onDelete:H},null,8,["selected"])]),e(b).md?(s(),o(e(q),{key:0,modelValue:p.value,"onUpdate:modelValue":l[0]||(l[0]=a=>p.value=a),placeholder:"Search by run name",label:"Search by run name"},null,8,["modelValue"])):f("",!0),u(e(J),{modelValue:e(t).sort,"onUpdate:modelValue":l[1]||(l[1]=a=>e(t).sort=a)},null,8,["modelValue"])]),u(e(M),{selected:n.value,"onUpdate:selected":l[2]||(l[2]=a=>n.value=a),"flow-runs":e(v)},null,8,["selected","flow-runs"]),e(v).length?f("",!0):(s(),o(e(Y),{key:0},Z({_:2},[e(B)?{name:"actions",fn:i(()=>[u(U,{size:"sm",secondary:"",onClick:D},{default:i(()=>[ee(" Clear Filters ")]),_:1})]),key:"0"}:void 0]),1024))])],64))],64)):f("",!0)]),_:1})}}});export{de as default};
