import{d as y,K as _,b as g,t as h,z as d,H as J}from"./registerWidgets.5bbfbb1a.js";import{f as k,g as w,h as C}from"./icons.96408396.js";import{a as I}from"./asyncComputed.0fa43cb9.js";import{J as u}from"./jobs.927b18b2.js";import{R as x}from"./RuntimeList.dbc1a5b4.js";import"./activeRecord.0bf8afc8.js";import"./DropdownMenu.1816b8ae.js";import"./CircularLoading.fd9aaeaa.js";import"./lottie.5c7f29e3.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]="ce4c156c-68ad-4f9f-a324-7f7b50804647",n._sentryDebugIdIdentifier="sentry-dbid-ce4c156c-68ad-4f9f-a324-7f7b50804647")}catch{}})();const U=y({__name:"Jobs",setup(n){const i=J(),{loading:r,result:a,refetch:c}=I(()=>u.list()),l=({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()),c()},p=async()=>{const e=await u.create();l({key:e.identifier})},b=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()),c())},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:b,dangerous:!0},{icon:w,label:"Edit Job",onClick:l},{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:p},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Jobs.cdca914e.js.map
