import{d as m,J as y,L as _,b as J,u as g,A as h}from"./registerWidgets.2f354556.js";import{e as k,f as w,g as C}from"./icons.1cdfa11b.js";import{a as I}from"./asyncComputed.7c1b85ba.js";import{J as d}from"./jobs.36d8ff14.js";import{R as v}from"./RuntimeList.d806a58a.js";import"./activeRecord.931023a0.js";import"./pubsub.cb65003c.js";import"./DropdownMenu.f3f9574e.js";import"./CircularLoading.f70f248e.js";import"./lottie.61602e49.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]="fe016edf-d165-4afc-bf99-aa20275b7649",n._sentryDebugIdIdentifier="sentry-dbid-fe016edf-d165-4afc-bf99-aa20275b7649")}catch{}})();const U=m({__name:"Jobs",setup(n){const i=y(),{loading:r,result:a,refetch:c}=I(()=>d.list()),l=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=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()},f=async()=>{const e=await d.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())},p=_(()=>{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:u}]}]})))!=null?o:[]}});return(e,o)=>(J(),g(v,{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:f},null,8,["loading","table"]))}});export{U as default};
//# sourceMappingURL=Jobs.8adfdab5.js.map
