import{d as f,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.f120b477.js";import{e as w,a as C,b as k}from"./icons.c367c256.js";import{a as I}from"./asyncComputed.5ccd4614.js";import{J as d}from"./jobs.ec327d00.js";import{C as v}from"./CrudView.87b341af.js";import{a as x}from"./ant-design.13a5e655.js";import"./activeRecord.d87d7ef2.js";import"./pubsub.4681462f.js";import"./index.3ab4f365.js";import"./Title.3dc4e32d.js";import"./Form.ec892c10.js";import"./router.e3ecb487.js";import"./index.5818bfb2.js";import"./url.8af07297.js";import"./index.b96fbbd8.js";import"./index.3801d49d.js";import"./index.de46e6db.js";import"./index.54e8798a.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]="0c529b37-30cc-45a4-8dc2-476ce7277609",i._sentryDebugIdIdentifier="sentry-dbid-0c529b37-30cc-45a4-8dc2-476ce7277609")}catch{}})();const G=f({__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())},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: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:b.value,"entity-name":"Job",onCreate:m},null,8,["loading","table"]))}});export{G as default};
//# sourceMappingURL=Jobs.fc8d4af3.js.map
