import{d as y,K as _,b as g,t as h,z as l,H as J}from"./registerWidgets.39370cce.js";import{f as k,g as w,h as C}from"./icons.c1d7cae2.js";import{a as I}from"./asyncComputed.588e6ddd.js";import{J as u}from"./jobs.bb8321e7.js";import{R as x}from"./RuntimeList.c060a1d2.js";import"./activeRecord.fab7288a.js";import"./DropdownMenu.f1872b59.js";import"./CircularLoading.858c95df.js";import"./lottie.576b6dda.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]="970030b4-dc29-46e0-8c42-d263f0db6157",n._sentryDebugIdIdentifier="sentry-dbid-970030b4-dc29-46e0-8c42-d263f0db6157")}catch{}})();const U=y({__name:"Jobs",setup(n){const i=J(),{loading:r,result:a,refetch:c}=I(()=>u.list()),d=({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();d({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:d},{icon:C,label:"Duplicate",onClick:b}]}]})))!=null?o:[]}});return(e,o)=>(g(),h(x,{loading:l(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:l(m),onCreate:f},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Jobs.8f3a47e7.js.map
