import{d as y,K as _,b as g,t as h,z as d,H as J}from"./registerWidgets.0e006b6f.js";import{f as k,g as w,h as C}from"./icons.6bb7a228.js";import{a as I}from"./asyncComputed.62aacf33.js";import{J as b}from"./jobs.2479c9ee.js";import{R as x}from"./RuntimeList.4f02eb44.js";import"./activeRecord.d399634f.js";import"./pubsub.13db2123.js";import"./DropdownMenu.a8ccd533.js";import"./CircularLoading.091208e5.js";import"./lottie.b974d0b6.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]="3f2b61fb-15a6-40b9-99bb-9d5f7f537286",n._sentryDebugIdIdentifier="sentry-dbid-3f2b61fb-15a6-40b9-99bb-9d5f7f537286")}catch{}})();const $=y({__name:"Jobs",setup(n){const i=J(),{loading:r,result:a,refetch:l}=I(()=>b.list()),c=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),f=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()),l()},u=async()=>{const e=await b.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()),l())},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:f}]}]})))!=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:u},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Jobs.e4220d9e.js.map
