import{d as f,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.dcbaec6c.js";import{e as w,a as C,b as k}from"./icons.eaf14b7d.js";import{a as I}from"./asyncComputed.05eefdbd.js";import{J as l}from"./jobs.8d7f79b7.js";import{C as v}from"./CrudView.4ac6b440.js";import{a as x}from"./ant-design.f602ec67.js";import"./activeRecord.d9292c93.js";import"./pubsub.999268d8.js";import"./index.9fcba2ca.js";import"./Title.137468a8.js";import"./Form.94b2db91.js";import"./router.fe36cb8d.js";import"./index.678801af.js";import"./url.5c03711e.js";import"./index.69bd7c01.js";import"./index.12134aed.js";import"./index.87a757a5.js";import"./index.a56c5205.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[a]="3a62b8e4-9802-4ad1-bfc4-556ddaaac94e",i._sentryDebugIdIdentifier="sentry-dbid-3a62b8e4-9802-4ad1-bfc4-556ddaaac94e")}catch{}})();const G=f({__name:"Jobs",setup(i){const a=y(),{loading:s,result:n,refetch:d}=I(()=>l.list()),c=({key:e})=>a.push({path:`/_editor/job/${encodeURIComponent(e)}`}),p=async({key:e})=>{var o,t;await((t=(o=n.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.duplicate()),d()},m=async()=>{const e=await l.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=n.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.delete()),d())},b=_(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.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.f153e580.js.map
