import{d as A,aS as F,aT as R,aU as B,S as U,K as D,f as d,j as N,aV as T,g as c,c as i,o as n,h as l,p as w,a as k,F as j,m as e,aW as P,i as o,k as u,aX as W,aY as G,y as L,aZ as Y,a_ as E,D as H,A as I,G as J,a$ as K,ay as M,aC as O}from"./index-B8dvxl4J.js";import{u as X}from"./usePrefectApi-BCwktLUX.js";import"./mapper-Ccnhulit.js";const Z={class:"workspace-dashboard__header-actions"},$={class:"workspace-dashboard__subflows-toggle"},q={key:1,class:"workspace-dashboard__grid"},z={class:"workspace-dashboard__side"},te=A({__name:"Dashboard",async setup(Q){let r,p;F(B,{interval:R.secondsToMilliseconds(30)});const b=U(),h=X(),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(b.flowRuns.getFlowRunsCount,[{}]),f=d(()=>m.executed),g=d(()=>m.response===0),y=[{text:"Dashboard"}],s=T({range:{type:"span",seconds:-O},tags:[]}),C=()=>L.map("WorkspaceDashboardFilter",s,"TaskRunsFilter");return(ee,a)=>{const S=c("p-toggle"),V=c("p-button"),x=c("p-layout-default");return n(),i(x,{class:"workspace-dashboard"},{header:l(()=>[o(e(I),{crumbs:y,class:"workspace-dashboard__page-heading"},J({_:2},[f.value&&!g.value?{name:"actions",fn:l(()=>[u("div",Z,[u("div",$,[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(K),{selected:e(s).tags,"onUpdate:selected":a[1]||(a[1]=t=>e(s).tags=t),"empty-message":"All tags"},null,8,["selected"]),o(e(M),{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(j,{key:0},[g.value?(n(),i(e(P),{key:0})):(n(),w("div",q,[o(e(W),{filter:e(s)},null,8,["filter"]),u("div",z,[o(e(G),{filter:C}),o(e(Y),{class:"workspace-dashboard__work-pools",filter:e(s)},null,8,["filter"])])]))],64)):k("",!0),_.value?(n(),i(e(E),{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]=[H(" Upgrade to Cloud ",-1)])]),_:1})]),_:1})):k("",!0)]),_:1})}}});export{te as default};
//# sourceMappingURL=Dashboard-BU5I9yF7.js.map
