import{d as b,ey as y,H as _,b as g,c as h,u as w}from"./outputWidgets.8be138ba.js";import{e as C,a as J,b as k}from"./icons.35976e57.js";import{a as I}from"./asyncComputed.96c9ad3b.js";import{J as d}from"./jobs.abbd52e0.js";import{C as v}from"./CrudView.cfa43f1a.js";import{a as x}from"./ant-design.e9f581dc.js";import"./activeRecord.f6cce158.js";import"./pubsub.e324f67c.js";import"./index.98827a3d.js";import"./Title.12e8916a.js";import"./Form.7b75db7b.js";import"./router.bb47648a.js";import"./index.0df733bd.js";import"./url.ebe1e528.js";import"./index.3ef3e2d2.js";import"./index.bc7e7ec9.js";import"./index.d11a75f6.js";import"./index.568a8efe.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]="e14f6e10-04b7-4028-aff9-c47c3912396a",i._sentryDebugIdIdentifier="sentry-dbid-e14f6e10-04b7-4028-aff9-c47c3912396a")}catch{}})();const z=b({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:c}=I(()=>d.list()),l=({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 d.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=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:C,label:"Edit Job",onClick:l},{icon:J,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),h(v,{loading:w(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{z as default};
//# sourceMappingURL=Jobs.b13bcc01.js.map
