import{an as q,d as E,ao as G,j as u,ap as I,i as K,c as o,w as r,r as k,ah as $,o as s,a as l,u as e,aq as J,l as F,ar as L,G as C,as as M,at as Q,F as W,m as c,C as _,au as X,av as Y,aw as Z,ax as ee,t as g,ay as se,az as oe,U as te,K as ne}from"./index-4d9fe32c-718dc5d9.js";import{N as b,H as le}from"./prefect-design-a921a7c6.js";import{d as ae,c as i}from"./vue-compositions-55710141.js";import{u as ue}from"./usePageTitle-e8e2e29d.js";import"./index-558d177a.js";import{A as re}from"./ApiRoute-3ea941f2.js";import{r as ce}from"./routes-1bd54f1a.js";import"./meta-26546594.js";class ie extends re(q){}const de=ae(new ie),pe={class:"flow-runs__list"},me={class:"flow-runs__list-controls"},fe={class:"flow-runs__list-controls--right"},ge=E({__name:"FlowRuns",setup(V){const N=$(),d=G(),y=i(d.flowRuns.getFlowRunsCount,[{}]),x=u(()=>y.executed),S=u(()=>y.response===0),{filter:p,hasFilters:A,startDate:D,endDate:H,name:m,sort:f}=I(),w={interval:3e4},R=i(d.flowRuns.getFlowRunsCount,[p],w),U=u(()=>R.response),B=i(de.getFlowRunHistory,[p],w),T=u(()=>B.response??[]),v=i(d.flowRuns.getFlowRuns,[p],w),h=u(()=>v.response??[]),t=K([]);function z(){N.push(ce.flowRuns())}const O=()=>{t.value=[],v.refresh(),R.refresh()};return ue("Flow Runs"),(we,n)=>{const P=k("p-button"),j=k("p-layout-default");return s(),o(j,{class:"flow-runs"},{header:r(()=>[l(e(J))]),default:r(()=>[e(x)?(s(),F(C,{key:0},[e(S)?(s(),o(e(L),{key:0})):(s(),F(C,{key:1},[l(e(M)),e(b).md?(s(),o(e(Q),W({key:0,history:e(T)},{startDate:e(D),endDate:e(H)},{class:"flow-runs__chart"}),null,16,["history"])):c("",!0),_("div",pe,[_("div",me,[_("div",fe,[t.value.length==0?(s(),o(e(X),{key:0,count:e(U),label:"Flow run"},null,8,["count"])):(s(),o(e(Y),{key:1,count:t.value.length},null,8,["count"])),l(e(Z),{selected:t.value,onDelete:O},null,8,["selected"])]),e(b).md?(s(),o(e(ee),{key:0,modelValue:e(m),"onUpdate:modelValue":n[0]||(n[0]=a=>g(m)?m.value=a:null),placeholder:"Search by run name",label:"Search by run name"},null,8,["modelValue"])):c("",!0),l(e(se),{modelValue:e(f),"onUpdate:modelValue":n[1]||(n[1]=a=>g(f)?f.value=a:null)},null,8,["modelValue"])]),l(e(oe),{selected:t.value,"onUpdate:selected":n[2]||(n[2]=a=>t.value=a),"flow-runs":e(h)},null,8,["selected","flow-runs"]),e(h).length?c("",!0):(s(),o(e(le),{key:0},te({_:2},[e(A)?{name:"actions",fn:r(()=>[l(P,{size:"sm",secondary:"",onClick:z},{default:r(()=>[ne(" Clear Filters ")]),_:1})]),key:"0"}:void 0]),1024))])],64))],64)):c("",!0)]),_:1})}}});export{ge as default};
