import{d as b,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.800838e3.js";import{e as w,a as C,b as k}from"./icons.93f59c4e.js";import{a as I}from"./asyncComputed.982dc1f5.js";import{J as d}from"./jobs.c91fe07e.js";import{C as v}from"./CrudView.b259bd34.js";import{a as x}from"./ant-design.74cbd470.js";import"./activeRecord.9d8d542d.js";import"./pubsub.3b460539.js";import"./index.e0615505.js";import"./Title.28613ffd.js";import"./Form.b8148ab8.js";import"./router.ba9fc25a.js";import"./index.cc2e9ddf.js";import"./url.e7bb6b8a.js";import"./index.9edddcd4.js";import"./index.70fbd67e.js";import"./index.c4440e89.js";import"./index.960544fb.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]="d252a31b-a648-4a12-a579-a4736fc7f604",i._sentryDebugIdIdentifier="sentry-dbid-d252a31b-a648-4a12-a579-a4736fc7f604")}catch{}})();const G=b({__name:"Jobs",setup(i){const a=y(),{loading:s,result:n,refetch:l}=I(()=>d.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()),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=n.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=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:f.value,"entity-name":"Job",onCreate:m},null,8,["loading","table"]))}});export{G as default};
//# sourceMappingURL=Jobs.1c5799a3.js.map
