import{d as b,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.cf5b7366.js";import{e as w,a as C,b as k}from"./icons.c510a141.js";import{a as I}from"./asyncComputed.2caa7fe6.js";import{J as l}from"./jobs.b1b148c3.js";import{C as v}from"./CrudView.ca1846b4.js";import{a as x}from"./ant-design.55c856ad.js";import"./activeRecord.f30e02c2.js";import"./pubsub.664a70af.js";import"./index.7622dd54.js";import"./Title.adce1298.js";import"./Form.c8affe88.js";import"./router.565b4739.js";import"./index.3d2fbf9e.js";import"./url.fb40e08c.js";import"./index.47f17eed.js";import"./index.aee8b5d5.js";import"./index.9583d9e9.js";import"./index.10cdfb2c.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]="f98eed41-f7c2-44c1-a640-3cdcf1d0f1dc",i._sentryDebugIdIdentifier="sentry-dbid-f98eed41-f7c2-44c1-a640-3cdcf1d0f1dc")}catch{}})();const G=b({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:c}=I(()=>l.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()),c()},m=async()=>{const e=await l.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()),c())},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.f43986b4.js.map
