import{d as f,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.b13a87c2.js";import{e as k,a as w,b as C}from"./icons.76c1fe8b.js";import{a as I}from"./asyncComputed.02afd50e.js";import{J as d}from"./jobs.a3ced864.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.cf244ae9.js";import{a as x}from"./ant-design.b9e555b3.js";import"./activeRecord.f5a2d19d.js";import"./pubsub.dab46576.js";import"./index.957937c4.js";import"./Title.6f86755a.js";import"./Form.e21e0d73.js";import"./index.fbf04eaa.js";import"./index.24360d49.js";import"./index.1b5bc05c.js";import"./index.73746068.js";import"./index.55a2786b.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[a]="b06772a8-0c1d-4667-9a27-5a1b3bafe561",i._sentryDebugIdIdentifier="sentry-dbid-b06772a8-0c1d-4667-9a27-5a1b3bafe561")}catch{}})();const q=f({__name:"Jobs",setup(i){const a=y(),{loading:s,result:n,refetch:l}=I(()=>d.list()),c=({key:e})=>a.push({path:`/_editor/job/${encodeURIComponent(e)}`}),m=async({key:e})=>{var o,t;await((t=(o=n.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.duplicate()),l()},p=async()=>{const e=await d.create();c({key:e.identifier})},u=async({key:e})=>{var o,t;await x("Are you sure you want to delete this job?")&&(await((t=(o=n.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=n.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:c},{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.161e7693.js.map
