import{d as y,K as _,b as g,t as h,z as c,H as J}from"./registerWidgets.cbdb5b20.js";import{f as k,g as w,h as C}from"./icons.0be4624f.js";import{a as I}from"./asyncComputed.0300d9e5.js";import{J as f}from"./jobs.b2e49a77.js";import{R as x}from"./RuntimeList.e1172034.js";import"./activeRecord.aaef4d59.js";import"./DropdownMenu.fc9bfa79.js";import"./CircularLoading.afc6a364.js";import"./lottie.3c633a53.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="ba8229d1-7be9-41e5-b37f-fd2fafa092ad",n._sentryDebugIdIdentifier="sentry-dbid-ba8229d1-7be9-41e5-b37f-fd2fafa092ad")}catch{}})();const U=y({__name:"Jobs",setup(n){const a=J(),{loading:r,result:i,refetch:d}=I(()=>f.list()),l=({key:e})=>a.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=async({key:e})=>{var o,t;await((t=(o=i.value)==null?void 0:o.find(s=>s.identifier===e))==null?void 0:t.duplicate()),d()},b=async()=>{const e=await f.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=i.value)==null?void 0:o.find(s=>s.identifier===e))==null?void 0:t.delete()),d())},m=_(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Path"},{name:"Job Actions"}],rows:(o=(e=i.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(),h(x,{loading:c(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:c(m),onCreate:b},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Jobs.1ff30a15.js.map
