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.17e2270d.js";import{e as x,a as I,b as v}from"./icons.ae606380.js";import{a as D}from"./asyncComputed.c8589796.js";import{J as p}from"./jobs.5a9560be.js";import{C as N}from"./CrudView.0a7d7224.js";import{a as P}from"./ant-design.8d97eacb.js";import"./activeRecord.1230459a.js";import"./pubsub.52f6192d.js";import"./index.23cb8791.js";import"./Title.7b6ce571.js";import"./Form.0e9953f6.js";import"./router.845058a4.js";import"./index.4787064b.js";import"./url.6c73df07.js";import"./index.29151007.js";import"./index.4b3be88e.js";import"./index.cfd05648.js";import"./index.bedec2c6.js";import"./index.34b7172c.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]="6a1e1f0c-461e-421d-8245-11980d688f74",i._sentryDebugIdIdentifier="sentry-dbid-6a1e1f0c-461e-421d-8245-11980d688f74")}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: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})},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:d},{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(()=>[l(" Jobs are exclusive to Cloud plans. Visit our "),V,l(" to learn more. ")]),_:1},8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Jobs.d292cdd8.js.map
