import{d as f,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.541a6a3f.js";import{e as k,a as w,b as C}from"./icons.fbbc5318.js";import{a as I}from"./asyncComputed.6496ca6b.js";import{J as c}from"./jobs.8963c228.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.af69973c.js";import{a as x}from"./ant-design.e75c36c7.js";import"./activeRecord.867c40fa.js";import"./pubsub.8482a29f.js";import"./index.07910c0e.js";import"./Title.3011141f.js";import"./Form.2a9acb85.js";import"./index.f20ad580.js";import"./index.c3edc651.js";import"./index.3cff0676.js";import"./index.1797b918.js";import"./index.33fb7a48.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]="832ebff5-e2a4-46f4-b3e9-b028d87bd187",i._sentryDebugIdIdentifier="sentry-dbid-832ebff5-e2a4-46f4-b3e9-b028d87bd187")}catch{}})();const q=f({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:l}=I(()=>c.list()),d=({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()),l()},p=async()=>{const e=await c.create();d({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()),l())},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:d},{icon:w,label:"Duplicate",onClick:m},{icon:C,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:p},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Jobs.d810cc04.js.map
