import{d as m,ex as y,F as _,b as g,u as J,bu as h}from"./registerWidgets.d68712f0.js";import{e as k,f as w,g as C}from"./icons.24d45fbf.js";import{a as x}from"./asyncComputed.f9ea598c.js";import{J as c}from"./jobs.5c4c02ae.js";import{R as I}from"./RuntimeList.0775f6b1.js";import"./activeRecord.b8754928.js";import"./pubsub.5d7eaeae.js";import"./DropdownMenu.96853481.js";import"./CircularLoading.3dc537f5.js";import"./lottie.2b6a117e.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="313732da-aa9d-45eb-a6fd-89ba5a75630a",a._sentryDebugIdIdentifier="sentry-dbid-313732da-aa9d-45eb-a6fd-89ba5a75630a")}catch{}})();const $=m({__name:"Jobs",setup(a){const n=y(),{loading:r,result:i,refetch:d}=x(()=>c.list()),l=({key:e})=>n.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 c.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()),d())},p=_(()=>{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(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:p.value,onCreate:b},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Jobs.48f15638.js.map
