import{d as y,ey as g,G as _,b as h,c as w,w as C,u as J,aA as l,e as k}from"./outputWidgets.0fb707c7.js";import{e as x,a as v,b as I}from"./icons.24a85994.js";import{a as D}from"./asyncComputed.a0ca296c.js";import{J as p}from"./jobs.a07f20aa.js";import{C as N}from"./CrudView.e365e55f.js";import{a as P}from"./ant-design.c18e1d39.js";import"./activeRecord.204186f3.js";import"./pubsub.7d8bce56.js";import"./Text.3ec0a64d.js";import"./Title.f00a58f9.js";import"./transButton.220177fb.js";import"./router.81de177d.js";import"./Form.0dcb97c0.js";import"./index.140c5bc8.js";import"./url.d43b75f5.js";import"./index.85d2f01b.js";import"./index.8dbf2994.js";import"./index.0d3d2205.js";import"./index.e8ef1073.js";import"./index.a2e845fd.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[a]="adfe5c6d-fa47-46f6-86eb-7cb9344f1f69",i._sentryDebugIdIdentifier="sentry-dbid-adfe5c6d-fa47-46f6-86eb-7cb9344f1f69")}catch{}})();const V=k("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),X=y({__name:"Jobs",setup(i){const a=g(),{loading:s,result:n,refetch:c}=D(()=>p.list()),d=({key:e})=>a.push({path:`/_editor/job/${encodeURIComponent(e)}`}),m=async({key:e})=>{var o,t;await((t=(o=n.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.duplicate()),c()},f=async()=>{const e=await p.create();d({key:e.identifier})},u=async({key:e})=>{var o,t;await P("Are you sure you want to delete this job?")&&(await((t=(o=n.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.delete()),c())},b=_(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.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:x,label:"Edit Job",onClick:d},{icon:v,label:"Duplicate",onClick:m},{icon:I,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),w(N,{loading:J(s),title:"Python Jobs","create-button-text":"Create Job",description:"Schedule Python scripts like events on a calendar.","empty-title":"No jobs here yet",table:b.value,"entity-name":"Job",onCreate:f},{warning:C(()=>[l(" Jobs are exclusive to Cloud plans. Visit our "),V,l(" to learn more. ")]),_:1},8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Jobs.92f6f850.js.map
