import{d as b,ex as y,H as _,b as J,c as g,u as h}from"./registerWidgets.faec4901.js";import{e as k,a as w,b as C}from"./icons.4b27c20b.js";import{a as x}from"./asyncComputed.04758d6d.js";import{J as d}from"./jobs.b140b1fc.js";import{_ as I}from"./CrudView.vue_vue_type_script_setup_true_lang.3dfdcdc3.js";import"./activeRecord.64153c3d.js";import"./pubsub.c32c984e.js";import"./Modal.c4a3eb37.js";import"./Title.38629c7e.js";import"./transButton.389d0ba4.js";import"./index.bd454869.js";import"./Text.8913855c.js";import"./index.353431e1.js";import"./index.da74220a.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[i]="45495358-e294-450f-9e3e-b4f60c96f637",n._sentryDebugIdIdentifier="sentry-dbid-45495358-e294-450f-9e3e-b4f60c96f637")}catch{}})();const S=b({__name:"Jobs",setup(n){const i=y(),{loading:s,result:a,refetch:c}=x(()=>d.list()),l=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=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()},f=async()=>{const e=await d.create();l({key:e.identifier})},p=async({key:e})=>{var o,t;confirm("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())},m=_(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Path"},{name:"Job Actions"}],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:u},{icon:C,label:"Delete",onClick:p,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(J(),g(I,{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:m.value,"entity-name":"Job",onCreate:f},null,8,["loading","table"]))}});export{S as default};
//# sourceMappingURL=Jobs.17643741.js.map
