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