import{d as y,ey as g,H as _,b as h,c as w,w as C,u as J,aI as d,e as k}from"./outputWidgets.1739e6b5.js";import{e as x,a as I,b as v}from"./icons.1c3e2bde.js";import{a as D}from"./asyncComputed.b4d87a94.js";import{J as p}from"./jobs.7d056170.js";import{C as N}from"./CrudView.245e4133.js";import{a as P}from"./ant-design.6ecbca2a.js";import"./activeRecord.55a23e4a.js";import"./pubsub.e4395938.js";import"./Text.f4c0ef3e.js";import"./Title.1261c75a.js";import"./Form.6a4829ad.js";import"./router.95125983.js";import"./index.92715e30.js";import"./url.8bddfe76.js";import"./index.aaa812ca.js";import"./index.663f575e.js";import"./index.366cf7e1.js";import"./index.8b3d4030.js";import"./index.55ff2de5.js";import"./index.fbff59b3.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="ccd6e281-9ae4-4c5e-aca4-29e0e033fe8a",a._sentryDebugIdIdentifier="sentry-dbid-ccd6e281-9ae4-4c5e-aca4-29e0e033fe8a")}catch{}})();const V=k("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),X=y({__name:"Jobs",setup(a){const i=g(),{loading:s,result:n,refetch:c}=D(()=>p.list()),l=({key:e})=>i.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()},u=async()=>{const e=await p.create();l({key:e.identifier})},f=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:l},{icon:I,label:"Duplicate",onClick:m},{icon:v,label:"Delete",onClick:f,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:u},{warning:C(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),V,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Jobs.31d896c7.js.map
