import{d as b,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.df0b7764.js";import{e as w,a as C,b as k}from"./icons.649962e7.js";import{a as I}from"./asyncComputed.46396f29.js";import{J as l}from"./jobs.7cde33de.js";import{C as v}from"./CrudView.c17fe492.js";import{a as x}from"./ant-design.3dd40e2b.js";import"./activeRecord.af31c98a.js";import"./pubsub.82647744.js";import"./index.0830e379.js";import"./Title.d627f1f5.js";import"./Form.29bcac3f.js";import"./router.7d542f8a.js";import"./index.8131d28d.js";import"./url.b34e96a5.js";import"./index.eb14364d.js";import"./index.b2e095c7.js";import"./index.5c49f4fd.js";import"./index.317ac553.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]="4bd7b6f4-5e45-4c04-96c0-2c5232f578de",i._sentryDebugIdIdentifier="sentry-dbid-4bd7b6f4-5e45-4c04-96c0-2c5232f578de")}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.e1a25733.js.map
