import{d as f,ey as y,H as _,b as g,c as h,u as w}from"./outputWidgets.397b3720.js";import{e as C,a as J,b as k}from"./icons.5e65f599.js";import{a as I}from"./asyncComputed.28fc9d36.js";import{J as c}from"./jobs.afb91f3b.js";import{C as v}from"./CrudView.77c1d16d.js";import{a as x}from"./ant-design.29edbf4a.js";import"./activeRecord.6bb6b853.js";import"./pubsub.fe0f0397.js";import"./index.19008df2.js";import"./Title.382247fb.js";import"./Form.5ce50c8f.js";import"./router.3bc1b205.js";import"./index.06276212.js";import"./url.53bc193a.js";import"./index.4acaedbb.js";import"./index.c9ea7155.js";import"./index.40ca2e79.js";import"./index.e12747aa.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]="de25d5b9-7d58-47ef-83d1-2cbbfd1d12a6",i._sentryDebugIdIdentifier="sentry-dbid-de25d5b9-7d58-47ef-83d1-2cbbfd1d12a6")}catch{}})();const z=f({__name:"Jobs",setup(i){const n=y(),{loading:d,result:a,refetch:s}=I(()=>c.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()),s()},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=a.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.delete()),s())},b=_(()=>{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(d),title:"Python Jobs",description:"Schedule Python scripts like events on a calendar","create-button-text":"Create Job","empty-title":"No jobs here yet",table:b.value,"entity-name":"Job",onCreate:m},null,8,["loading","table"]))}});export{z as default};
//# sourceMappingURL=Jobs.9608574d.js.map
