import{d as b,ex as y,F as _,b as g,u as J,bu as h}from"./registerWidgets.daf4e0d4.js";import{e as k,f as w,g as C}from"./icons.74a49ba5.js";import{a as x}from"./asyncComputed.ea0509ca.js";import{J as d}from"./jobs.6f2ae195.js";import{R as I}from"./RuntimeList.92fb0186.js";import"./activeRecord.8789da8d.js";import"./pubsub.bf966380.js";import"./DropdownMenu.e36b430d.js";import"./CircularLoading.56bf1e90.js";import"./lottie.1c3e1229.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]="d38cca03-1814-4a40-a8c8-3caca77a9749",n._sentryDebugIdIdentifier="sentry-dbid-d38cca03-1814-4a40-a8c8-3caca77a9749")}catch{}})();const $=b({__name:"Jobs",setup(n){const a=y(),{loading:c,result:i,refetch:r}=x(()=>d.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()),r()},p=async()=>{const e=await d.create();l({key:e.identifier})},f=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()),r())},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:f,dangerous:!0},{icon:w,label:"Edit Job",onClick:l},{icon:C,label:"Duplicate",onClick:u}]}]})))!=null?o:[]}});return(e,o)=>(g(),J(I,{loading:h(c),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:p},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Jobs.0dd80393.js.map
