import{d as f,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.75a5b0b9.js";import{e as k,a as w,b as C}from"./icons.c04528be.js";import{a as I}from"./asyncComputed.c701d7b0.js";import{J as d}from"./jobs.4af0de33.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.ff628288.js";import{a as x}from"./ant-design.7c6678de.js";import"./activeRecord.115270b9.js";import"./pubsub.3fa240d3.js";import"./index.49e953af.js";import"./Title.b6c9692d.js";import"./Form.2c716183.js";import"./index.e24c456b.js";import"./index.5a67eb5f.js";import"./index.9c0809a0.js";import"./index.5e9c5434.js";import"./index.4598445f.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]="a0b7c0b1-60e5-4cbc-b1ac-ace9719998c6",i._sentryDebugIdIdentifier="sentry-dbid-a0b7c0b1-60e5-4cbc-b1ac-ace9719998c6")}catch{}})();const q=f({__name:"Jobs",setup(i){const n=y(),{loading:c,result:a,refetch:s}=I(()=>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()),s()},p=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()),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: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(),J(v,{loading:h(c),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.9f2dd227.js.map
