import{d as f,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.65926c1d.js";import{e as w,a as C,b as k}from"./icons.da7d27cd.js";import{a as I}from"./asyncComputed.4723d9b8.js";import{J as d}from"./jobs.4fb3de9f.js";import{C as v}from"./CrudView.bb677fb8.js";import{a as x}from"./ant-design.14676eb3.js";import"./activeRecord.994400e6.js";import"./pubsub.dc5bec39.js";import"./index.2740d90e.js";import"./Title.2cced18a.js";import"./Form.47548ee6.js";import"./router.52af5430.js";import"./index.553ada1f.js";import"./url.bc2b44ba.js";import"./index.0312767e.js";import"./index.006c6212.js";import"./index.73801d39.js";import"./index.1bb9605d.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[n]="12e9a001-8153-487b-9b01-133e27848054",i._sentryDebugIdIdentifier="sentry-dbid-12e9a001-8153-487b-9b01-133e27848054")}catch{}})();const G=f({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:l}=I(()=>d.list()),c=({key:e})=>n.push({path:`/_editor/job/${encodeURIComponent(e)}`}),p=async({key:e})=>{var o,t;await((t=(o=a.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.duplicate()),l()},m=async()=>{const e=await d.create();c({key:e.identifier})},u=async({key:e})=>{var o,t;await x("Are you sure you want to delete this job?")&&(await((t=(o=a.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.delete()),l())},b=_(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=a.value)==null?void 0:e.map(t=>({key:t.identifier,cells:[{text:t.title,link:`/_editor/job/${encodeURIComponent(t.identifier)}`},{text:t.identifier},{text:"",actions:[{icon:w,label:"Edit Job",onClick:c},{icon:C,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),J(v,{loading:h(s),title:"Python Jobs",description:"Schedule Python scripts like events on a calendar","create-button-text":"Create Job","empty-title":"No jobs here yet",table:b.value,"entity-name":"Job",onCreate:m},null,8,["loading","table"]))}});export{G as default};
//# sourceMappingURL=Jobs.47978a3e.js.map
