import{d as y,K as _,b as g,t as h,z as d,H as J}from"./registerWidgets.bbbd3e16.js";import{f as k,g as w,h as C}from"./icons.3f47812d.js";import{a as I}from"./asyncComputed.ad67be0e.js";import{J as u}from"./jobs.2ba1be47.js";import{R as x}from"./RuntimeList.0819945d.js";import"./activeRecord.9842b68f.js";import"./DropdownMenu.f54cc23f.js";import"./CircularLoading.85040470.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]="84f7527b-2635-443e-bb3f-2742308088dc",n._sentryDebugIdIdentifier="sentry-dbid-84f7527b-2635-443e-bb3f-2742308088dc")}catch{}})();const N=y({__name:"Jobs",setup(n){const i=J(),{loading:r,result:a,refetch:c}=I(()=>u.list()),l=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),b=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()),c()},f=async()=>{const e=await u.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()),c())},m=_(()=>{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:b}]}]})))!=null?o:[]}});return(e,o)=>(g(),h(x,{loading:d(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:d(m),onCreate:f},null,8,["loading","table"]))}});export{N as default};
//# sourceMappingURL=Jobs.d0834eaa.js.map
