import{d as b,ex as y,H as _,b as g,c as h,u as J}from"./registerWidgets.ca9618c6.js";import{e as k,a as w,b as C}from"./icons.71da0300.js";import{a as x}from"./asyncComputed.f26ab310.js";import{J as d}from"./jobs.915e461d.js";import{_ as I}from"./CrudView.vue_vue_type_script_setup_true_lang.0535df40.js";import{a as v}from"./ant-design.c8da8814.js";import"./activeRecord.fa727ba5.js";import"./pubsub.197ceb4e.js";import"./index.6cc8ffe0.js";import"./Title.f740cc19.js";import"./Form.fac64e0c.js";import"./index.11818713.js";import"./index.b013a4c0.js";import"./index.c0bd1022.js";import"./index.7c566b28.js";import"./index.6a4df70c.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]="2a5bcf83-984c-4854-9af8-559562e1f534",i._sentryDebugIdIdentifier="sentry-dbid-2a5bcf83-984c-4854-9af8-559562e1f534")}catch{}})();const q=b({__name:"Jobs",setup(i){const n=y(),{loading:s,result:a,refetch:c}=x(()=>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 v("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(),h(I,{loading:J(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.2da1e8f0.js.map
