import{d as m,ex as y,F as _,b as g,u as J,bu as h}from"./registerWidgets.6f5be576.js";import{e as k,f as w,g as C}from"./icons.b2622455.js";import{a as x}from"./asyncComputed.ea0bb8a8.js";import{J as c}from"./jobs.9ba3056a.js";import{R as I}from"./RuntimeList.b1e20eb7.js";import"./activeRecord.eb203c6f.js";import"./pubsub.1dc45978.js";import"./DropdownMenu.ecdd2e52.js";import"./CircularLoading.63d0a6e6.js";import"./lottie.df73e4a1.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[i]="24be0e62-5f6d-4ed8-92de-4660d46f651a",n._sentryDebugIdIdentifier="sentry-dbid-24be0e62-5f6d-4ed8-92de-4660d46f651a")}catch{}})();const $=m({__name:"Jobs",setup(n){const i=y(),{loading:r,result:a,refetch:d}=x(()=>c.list()),l=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=async({key:e})=>{var o,t;await((t=(o=a.value)==null?void 0:o.find(s=>s.identifier===e))==null?void 0:t.duplicate()),d()},f=async()=>{const e=await c.create();l({key:e.identifier})},p=async({key:e})=>{var o,t;confirm("Are you sure you want to delete this job?")&&(await((t=(o=a.value)==null?void 0:o.find(s=>s.identifier===e))==null?void 0:t.delete()),d())},b=_(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Path"},{name:"Job Actions"}],rows:(o=(e=a.value)==null?void 0:e.map(t=>({key:t.identifier,cells:[{text:t.title,classes:["title","centered"],link:`/_editor/job/${encodeURIComponent(t.identifier)}`},{text:t.identifier},{text:"",classes:["centered"],actions:[{icon:k,label:"Delete",onClick:p,dangerous:!0},{icon:w,label:"Edit Job",onClick:l},{icon:C,label:"Duplicate",onClick:u}]}]})))!=null?o:[]}});return(e,o)=>(g(),J(I,{loading:h(r),title:"Python Jobs",description:"Schedule Python scripts like events on a calendar","create-button-text":"Create Job","empty-title":"No jobs here yet",table:b.value,onCreate:f},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Jobs.21429f06.js.map
