import{d as h,ez as g,G as _,b as w,c as C,w as k,u as x,az as c,e as J}from"./outputWidgets.723dbd35.js";import{J as l}from"./jobs.99ca1e55.js";import{e as v,d as I}from"./icons.d199659e.js";import{a as D}from"./asyncComputed.6087fd05.js";import{a as m}from"./ant-design.64772334.js";import{C as N}from"./CrudView.ca2cf6ee.js";import"./record.c3c42720.js";import"./pubsub.97441533.js";import"./index.c827a0f6.js";import"./Title.ad9727d9.js";import"./Form.71a7af16.js";import"./router.c09623bf.js";import"./index.b41dfd0a.js";import"./index.d0473694.js";import"./url.c8598ea1.js";import"./index.4913d787.js";import"./index.f91ebf4c.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[i]="fd472f57-a047-406d-8d43-2c9c75ebaddc",o._sentryDebugIdIdentifier="sentry-dbid-fd472f57-a047-406d-8d43-2c9c75ebaddc")}catch{}})();const T=J("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),H=h({__name:"Jobs",setup(o){const i=g(),{loading:n,result:r,refetch:p}=D(()=>l.list()),s=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=async()=>{const e=await l.create();s({key:e.id})},b=async({key:e})=>{var t,d;const a=await m("Do you want to delete the .py file associated with this job?",{okText:"Yes",cancelText:"No"});await m("Are you sure you want to delete this job?")&&(await((d=(t=r.value)==null?void 0:t.find(y=>y.id===e))==null?void 0:d.delete(a)),p())},f=_(()=>{var e,a;return{columns:[{name:"Job Name"},{name:"Schedule"},{name:"File"},{name:"Actions",align:"right"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/job/${encodeURIComponent(t.id)}`},{text:t.schedule},{text:t.file},{text:"",actions:[{icon:v,label:"Edit Job",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(w(),C(N,{loading:x(n),title:"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:k(()=>[c(" Jobs are exclusive to Cloud plans. Visit our "),T,c(" to learn more. ")]),_:1},8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Jobs.7b11280c.js.map
