import{d as b,ez as y,J as _,b as g,c as J,u as h}from"./outputWidgets.b9aa154a.js";import{e as k,a as w,b as C}from"./icons.4ed83c58.js";import{a as I}from"./asyncComputed.9bda3979.js";import{J as d}from"./jobs.193d98cf.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.8866a12f.js";import{a as x}from"./ant-design.a6411a07.js";import"./activeRecord.8939db5d.js";import"./pubsub.967f482a.js";import"./index.55488473.js";import"./Title.6cd833fd.js";import"./Form.55f226f4.js";import"./index.ea68e603.js";import"./index.14f3ef13.js";import"./index.23063916.js";import"./index.45ef6041.js";import"./index.6b140cad.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]="f7099127-efac-4b1d-8319-e61b57713c12",i._sentryDebugIdIdentifier="sentry-dbid-f7099127-efac-4b1d-8319-e61b57713c12")}catch{}})();const q=b({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:c}=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()),c()},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()),c())},f=_(()=>{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(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:f.value,"entity-name":"Job",onCreate:p},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Jobs.d8210795.js.map
