import{d as f,ez as b,J as y,b as D,c as w,u as _}from"./outputWidgets.b43a489b.js";import{e as g,a as k,b as C}from"./icons.de9af46a.js";import{a as v}from"./asyncComputed.a42e75bb.js";import{D as d}from"./dashes.952e2e3f.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.85d5e2a7.js";import{a as I}from"./ant-design.dc7acb1e.js";import"./activeRecord.2bc5cc59.js";import"./pubsub.6fd47a9d.js";import"./index.42b92ee8.js";import"./index.85f24c29.js";import"./Title.47040052.js";import"./Form.1797df89.js";import"./index.0279b5ff.js";import"./index.e641ddba.js";import"./index.8a60ee51.js";import"./index.9367a16c.js";import"./index.65dea612.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="7f39ab7a-f7fb-4483-b17c-e70bfe983aab",o._sentryDebugIdIdentifier="sentry-dbid-7f39ab7a-f7fb-4483-b17c-e70bfe983aab")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=b(),{loading:r,result:n,refetch:c}=v(()=>d.list()),l=({key:e})=>s.push({name:"dashEditor",params:{dashPath:e}}),p=async({key:e})=>{var a,t;await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.duplicate()),c()},m=async()=>{const e=await d.create();l({key:e.path})},u=async({key:e})=>{var a,t;await I("Are you sure you want to delete this dash?")&&(await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.delete()),c())},h=y(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:g,label:"Edit Dash",onClick:l},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:_(r),title:"Python Dashes",description:"Create a dashboard page with charts and inputs interacting with your python code.","create-button-text":"Create Dash","empty-title":"No dashes here yet","video-url":"https://www.youtube.com/embed/oYMptrk7QNE",table:h.value,"entity-name":"Dash",onCreate:m},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Dashes.44e62c28.js.map
