import{d as f,ex as y,H as _,b as g,c as h,u as J}from"./registerWidgets.9fce82a0.js";import{e as k,a as w,b as C}from"./icons.1992e13b.js";import{a as x}from"./asyncComputed.a4b709a3.js";import{J as d}from"./jobs.ffce9a38.js";import{_ as I}from"./CrudView.vue_vue_type_script_setup_true_lang.ac5a77d6.js";import{a as v}from"./ant-design.cd2520f8.js";import"./activeRecord.872f4269.js";import"./pubsub.025cc397.js";import"./index.2c964e80.js";import"./Title.26974edb.js";import"./Form.413853c0.js";import"./index.eed9c711.js";import"./index.30c35b37.js";import"./index.c9f7f8f0.js";import"./index.db5cf0e6.js";import"./index.e8158c16.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]="47931e41-d0b7-4302-8ec8-b0dae50c8c3f",i._sentryDebugIdIdentifier="sentry-dbid-47931e41-d0b7-4302-8ec8-b0dae50c8c3f")}catch{}})();const q=f({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:c}=x(()=>d.list()),l=({key:e})=>n.push({path:`/_editor/job/${encodeURIComponent(e)}`}),m=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()},p=async()=>{const e=await d.create();l({key:e.identifier})},u=async({key:e})=>{var o,t;await v("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:k,label:"Edit Job",onClick:l},{icon:w,label:"Duplicate",onClick:m},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),h(I,{loading:J(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:p},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Jobs.e3111445.js.map
