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.6d6b4a37.js";import{J as d}from"./jobs.18f2760c.js";import{e as v,d as I}from"./icons.28d0d847.js";import{a as D}from"./asyncComputed.17a6198d.js";import{a as m}from"./ant-design.c99b7781.js";import{C as N}from"./CrudView.230a173f.js";import"./record.7835c07e.js";import"./pubsub.7d377b25.js";import"./index.f2a53bdb.js";import"./Title.b41b4f96.js";import"./Form.1ff54ed5.js";import"./router.4e9df257.js";import"./index.72c317ca.js";import"./index.0e216cc8.js";import"./url.b5fbb423.js";import"./index.9eddb8ae.js";import"./index.6f6e8ffd.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]="1056f864-1971-4953-91a0-5359c1e9e21e",o._sentryDebugIdIdentifier="sentry-dbid-1056f864-1971-4953-91a0-5359c1e9e21e")}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(()=>d.list()),s=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=async()=>{const e=await d.create();s({key:e.id})},b=async({key:e})=>{var t,l;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((l=(t=r.value)==null?void 0:t.find(y=>y.id===e))==null?void 0:l.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.be1f4784.js.map
