import{d as m,ex as y,F as _,b as g,u as J,bu as h}from"./registerWidgets.2d3a9fa1.js";import{e as k,f as w,g as C}from"./icons.ef35efa7.js";import{a as x}from"./asyncComputed.da67dddd.js";import{J as l}from"./jobs.a99bb3d5.js";import{R as I}from"./RuntimeList.82829d0e.js";import"./activeRecord.85525a95.js";import"./pubsub.f5cc447b.js";import"./DropdownMenu.1c4bd517.js";import"./CircularLoading.7f8cdc69.js";import"./lottie.8f8e4fb5.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]="aca0cd2b-d32d-4e5b-ba0b-a3fe43ee4a40",n._sentryDebugIdIdentifier="sentry-dbid-aca0cd2b-d32d-4e5b-ba0b-a3fe43ee4a40")}catch{}})();const $=m({__name:"Jobs",setup(n){const a=y(),{loading:r,result:i,refetch:c}=x(()=>l.list()),d=({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()),c()},b=async()=>{const e=await l.create();d({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()),c())},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:d},{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.de463939.js.map
