import{d as f,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.300f3e96.js";import{e as w,a as C,b as k}from"./icons.faa6dbaa.js";import{a as I}from"./asyncComputed.6561fe78.js";import{J as l}from"./jobs.5cb7afa3.js";import{C as v}from"./CrudView.0d50f6ef.js";import{a as x}from"./ant-design.e9641753.js";import"./activeRecord.6e31bcda.js";import"./pubsub.f4c4af7d.js";import"./index.b12dda90.js";import"./Title.f9e3ac72.js";import"./Form.e5ad8df8.js";import"./router.fdc19966.js";import"./index.4c022ec6.js";import"./url.f346bb44.js";import"./index.f69106a7.js";import"./index.0deb6cbe.js";import"./index.b49fb559.js";import"./index.c74452a7.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]="ccd87095-7dd5-4948-ba99-e00155da5ed3",i._sentryDebugIdIdentifier="sentry-dbid-ccd87095-7dd5-4948-ba99-e00155da5ed3")}catch{}})();const G=f({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:d}=I(()=>l.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()),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=a.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=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.f2a3988a.js.map
