import{d as y,ey as g,H as _,b as h,c as w,w as C,u as J,aB as l,e as k}from"./outputWidgets.d6334d0e.js";import{e as x,a as v,b as I}from"./icons.09e1f108.js";import{a as D}from"./asyncComputed.95fd0999.js";import{J as p}from"./jobs.bc007f42.js";import{C as B}from"./CrudView.a040df87.js";import{a as N}from"./ant-design.765336cf.js";import"./activeRecord.aa738a85.js";import"./pubsub.9d7d329e.js";import"./Text.2f6a30da.js";import"./Title.132c3f7f.js";import"./transButton.97ae4a5a.js";import"./router.c9839d0e.js";import"./Form.afe8a620.js";import"./index.85dd1fea.js";import"./url.dce42ecb.js";import"./index.9476b093.js";import"./index.e0fb68fa.js";import"./index.98d66b02.js";import"./index.2221e01c.js";import"./index.6da051f8.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]="596970af-71db-495c-9c7b-f3399c2cad91",i._sentryDebugIdIdentifier="sentry-dbid-596970af-71db-495c-9c7b-f3399c2cad91")}catch{}})();const P=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()},u=async()=>{const e=await p.create();d({key:e.identifier})},b=async({key:e})=>{var o,t;await N("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())},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:d},{icon:v,label:"Duplicate",onClick:m},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),w(B,{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 "),P,l(" to learn more. ")]),_:1},8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Jobs.89e24ac3.js.map
