import{d as b,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.5f5dca9f.js";import{e as w,a as C,b as k}from"./icons.a77543dc.js";import{a as I}from"./asyncComputed.eae0c0ea.js";import{J as c}from"./jobs.c17d5857.js";import{C as v}from"./CrudView.f3b7e8d3.js";import{a as x}from"./ant-design.b34b2997.js";import"./activeRecord.ad81cab4.js";import"./pubsub.628f19a6.js";import"./index.d2da0107.js";import"./Title.c2ba09dc.js";import"./Form.09052538.js";import"./router.a7910fab.js";import"./index.92c8cf6e.js";import"./url.1555ad6e.js";import"./index.f5a72b75.js";import"./index.10f6bb5a.js";import"./index.7ef152c5.js";import"./index.7ab474e7.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]="f448de9f-2ff2-4a64-b2cd-9be2a92a3a46",i._sentryDebugIdIdentifier="sentry-dbid-f448de9f-2ff2-4a64-b2cd-9be2a92a3a46")}catch{}})();const G=b({__name:"Jobs",setup(i){const a=y(),{loading:s,result:n,refetch:d}=I(()=>c.list()),l=({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()),d()},m=async()=>{const e=await c.create();l({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()),d())},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:l},{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.263330bd.js.map
