import{d as b,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.ec044eb8.js";import{e as w,a as C,b as k}from"./icons.a554ebda.js";import{a as I}from"./asyncComputed.70e28ece.js";import{J as c}from"./jobs.8fb07b74.js";import{C as v}from"./CrudView.a07f1600.js";import{a as x}from"./ant-design.50ece8f6.js";import"./activeRecord.eb528dd4.js";import"./pubsub.33b79e26.js";import"./index.cdce8068.js";import"./Title.85fa9137.js";import"./Form.316ac787.js";import"./router.8cea9830.js";import"./index.6e43b5b9.js";import"./url.a1da359b.js";import"./index.67245513.js";import"./index.d97f12e1.js";import"./index.cd569242.js";import"./index.185a1704.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]="e9684472-1348-40bf-a93e-7df3fefe46be",i._sentryDebugIdIdentifier="sentry-dbid-e9684472-1348-40bf-a93e-7df3fefe46be")}catch{}})();const G=b({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:l}=I(()=>c.list()),d=({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 c.create();d({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())},f=_(()=>{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:d},{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:f.value,"entity-name":"Job",onCreate:m},null,8,["loading","table"]))}});export{G as default};
//# sourceMappingURL=Jobs.f6bc4d9e.js.map
