import{d as b,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.c072fe4e.js";import{e as k,a as w,b as C}from"./icons.158b4825.js";import{a as I}from"./asyncComputed.376cdc00.js";import{J as d}from"./jobs.50b17e33.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.9296340f.js";import{a as x}from"./ant-design.5cb2a38e.js";import"./activeRecord.fdc25b97.js";import"./pubsub.98ad9fe0.js";import"./index.4cff163b.js";import"./Title.e3dcb8ea.js";import"./Form.9f52866c.js";import"./index.4e6af937.js";import"./index.d9c3e0de.js";import"./index.2e3640f1.js";import"./index.e7c5574b.js";import"./index.ec8e038a.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]="c9e80fde-6f76-4900-8200-21f9079dfea8",i._sentryDebugIdIdentifier="sentry-dbid-c9e80fde-6f76-4900-8200-21f9079dfea8")}catch{}})();const q=b({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:l}=I(()=>d.list()),c=({key:e})=>n.push({path:`/_editor/job/${encodeURIComponent(e)}`}),f=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()},m=async()=>{const e=await d.create();c({key:e.identifier})},p=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())},u=_(()=>{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:c},{icon:w,label:"Duplicate",onClick:f},{icon:C,label:"Delete",onClick:p,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:u.value,"entity-name":"Job",onCreate:m},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Jobs.c9435eff.js.map
