import{d as f,ex as y,H as _,b as J,c as g,u as h}from"./registerWidgets.1e9167ab.js";import{e as k,a as w,b as C}from"./icons.41af03d8.js";import{a as x}from"./asyncComputed.8a644895.js";import{J as d}from"./jobs.10e8045a.js";import{_ as I}from"./CrudView.vue_vue_type_script_setup_true_lang.e0bf9fc2.js";import"./activeRecord.60b6bd01.js";import"./pubsub.09eafe35.js";import"./Modal.b646cd22.js";import"./Title.d1f45d59.js";import"./transButton.755e702e.js";import"./index.9165a659.js";import"./Text.c8d7b4c0.js";import"./index.32c7f8ee.js";import"./index.d74062f4.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]="45b13da5-1618-4411-b8e6-e4274144230f",n._sentryDebugIdIdentifier="sentry-dbid-45b13da5-1618-4411-b8e6-e4274144230f")}catch{}})();const S=f({__name:"Jobs",setup(n){const i=y(),{loading:s,result:a,refetch:l}=x(()=>d.list()),c=({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()),l()},p=async()=>{const e=await d.create();c({key:e.identifier})},m=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()),l())},b=_(()=>{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:c},{icon:w,label:"Duplicate",onClick:u},{icon:C,label:"Delete",onClick:m,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:b.value,"entity-name":"Job",onCreate:p},null,8,["loading","table"]))}});export{S as default};
//# sourceMappingURL=Jobs.d4266ef8.js.map
