import{d as f,ex as y,H as _,b as J,c as g,u as h}from"./registerWidgets.e46eca28.js";import{a as k,e as w,b as C}from"./icons.db549bc5.js";import{a as x}from"./asyncComputed.15fd30e0.js";import{J as l}from"./jobs.08d5f9ac.js";import{R as I}from"./RuntimeList.972c6970.js";import"./activeRecord.d83b1b14.js";import"./pubsub.8f2ecd1e.js";import"./DropdownMenu.dd15f4e3.js";import"./CircularLoading.484aa2f6.js";import"./lottie.2b81658b.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]="66ddc0e8-c70d-464d-b00d-08e5adb82da9",n._sentryDebugIdIdentifier="sentry-dbid-66ddc0e8-c70d-464d-b00d-08e5adb82da9")}catch{}})();const $=f({__name:"Jobs",setup(n){const i=y(),{loading:d,result:a,refetch:r}=x(()=>l.list()),c=({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()),r()},b=async()=>{const e=await l.create();c({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()),r())},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:c},{icon:C,label:"Duplicate",onClick:u}]}]})))!=null?o:[]}});return(e,o)=>(J(),g(I,{loading:h(d),title:"Python Jobs",description:"Schedule Python scripts like events on a calendar","create-button-text":"Create Job","empty-title":"No jobs here yet",table:m.value,onCreate:b},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Jobs.074d3314.js.map
