import{d as F,aS as R,aT as A,aU as B,S as U,I as D,g as d,j as N,aV as P,h as c,c as u,o as n,i as l,n as w,a as b,F as T,m as e,aW as j,k as o,l as i,aX as I,aY as W,y as X,aZ as Y,a_ as z,B as E,z as H,D as L,a$ as M,ay as Z,aC as $}from"./index-CWv_Pcr2.js";import{u as q}from"./usePrefectApi-DefSgQ13.js";import"./mapper-CBOLB2hm.js";const G={class:"workspace-dashboard__header-actions"},J={class:"workspace-dashboard__subflows-toggle"},K={key:1,class:"workspace-dashboard__grid"},O={class:"workspace-dashboard__side"},te=F({__name:"Dashboard",async setup(Q){let r,p;R(B,{interval:A.secondsToMilliseconds(30)});const k=U(),h=q(),v=([r,p]=D(()=>h.admin.getSettings()),r=await r,p(),r),_=d(()=>v.server.ui.show_promotional_content);localStorage.setItem("prefect-show-promotional-content",String(_.value));const m=N(k.flowRuns.getFlowRunsCount,[{}]),f=d(()=>m.executed),g=d(()=>m.response===0),y=[{text:"Dashboard"}],s=P({range:{type:"span",seconds:-$},tags:[]}),C=()=>X.map("WorkspaceDashboardFilter",s,"TaskRunsFilter");return(ee,a)=>{const S=c("p-toggle"),V=c("p-button"),x=c("p-layout-default");return n(),u(x,{class:"workspace-dashboard"},{header:l(()=>[o(e(H),{crumbs:y,class:"workspace-dashboard__page-heading"},L({_:2},[f.value&&!g.value?{name:"actions",fn:l(()=>[i("div",G,[i("div",J,[o(S,{modelValue:e(s).hideSubflows,"onUpdate:modelValue":a[0]||(a[0]=t=>e(s).hideSubflows=t),append:"Hide subflows"},null,8,["modelValue"])]),o(e(M),{selected:e(s).tags,"onUpdate:selected":a[1]||(a[1]=t=>e(s).tags=t),"empty-message":"All tags"},null,8,["selected"]),o(e(Z),{modelValue:e(s).range,"onUpdate:modelValue":a[2]||(a[2]=t=>e(s).range=t),class:"workspace-dashboard__date-select"},null,8,["modelValue"])])]),key:"0"}:void 0]),1024)]),default:l(()=>[f.value?(n(),w(T,{key:0},[g.value?(n(),u(e(j),{key:0})):(n(),w("div",K,[o(e(I),{filter:e(s)},null,8,["filter"]),i("div",O,[o(e(W),{filter:C}),o(e(Y),{class:"workspace-dashboard__work-pools",filter:e(s)},null,8,["filter"])])]))],64)):b("",!0),_.value?(n(),u(e(z),{key:1,title:"Ready to scale?",subtitle:"Webhooks, role and object-level security, and serverless push work pools on Prefect Cloud"},{actions:l(()=>[o(V,{to:"https://www.prefect.io/cloud-vs-oss?utm_source=oss&utm_medium=oss&utm_campaign=oss&utm_term=none&utm_content=none",target:"_blank",primary:""},{default:l(()=>[...a[3]||(a[3]=[E(" Upgrade to Cloud ",-1)])]),_:1})]),_:1})):b("",!0)]),_:1})}}});export{te as default};
//# sourceMappingURL=Dashboard-DQYwDfYm.js.map
