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