import{d as y,ey as g,H as _,b as h,c as w,w as C,u as J,aI as l,e as k}from"./outputWidgets.9a4dffd5.js";import{e as x,a as I,b as v}from"./icons.d935dec9.js";import{a as D}from"./asyncComputed.947a021a.js";import{J as p}from"./jobs.9fc486b1.js";import{C as N}from"./CrudView.32e9e362.js";import{a as P}from"./ant-design.edc4db28.js";import"./activeRecord.6b2e89dc.js";import"./pubsub.25596209.js";import"./index.0d204717.js";import"./Title.72e90637.js";import"./Form.0ea0ca53.js";import"./router.e9c58c63.js";import"./index.a351ac5c.js";import"./url.152c5826.js";import"./index.c64df437.js";import"./index.c4327f7e.js";import"./index.d0b58c73.js";import"./index.3ecad98a.js";import"./index.0e22fd42.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]="d2ddd7b1-8277-4a25-9260-3002ddc89e79",i._sentryDebugIdIdentifier="sentry-dbid-d2ddd7b1-8277-4a25-9260-3002ddc89e79")}catch{}})();const V=k("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),W=y({__name:"Jobs",setup(i){const a=g(),{loading:s,result:n,refetch:d}=D(()=>p.list()),c=({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()),d()},u=async()=>{const e=await p.create();c({key:e.identifier})},b=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()),d())},f=_(()=>{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:c},{icon:I,label:"Duplicate",onClick:m},{icon:v,label:"Delete",onClick:b,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:f.value,"entity-name":"Job",onCreate:u},{warning:C(()=>[l(" Jobs are exclusive to Cloud plans. Visit our "),V,l(" to learn more. ")]),_:1},8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Jobs.526a78e6.js.map
