import{d as h,ez as g,G as _,b as w,c as C,w as k,u as x,az as l,e as J}from"./outputWidgets.3acae187.js";import{J as c}from"./jobs.f9bdba5e.js";import{e as v,d as I}from"./icons.238cb834.js";import{a as D}from"./asyncComputed.4acb40f3.js";import{a as m}from"./ant-design.0486e70d.js";import{C as N}from"./CrudView.ad3897c2.js";import"./record.8667ddd6.js";import"./pubsub.bc590f31.js";import"./index.ea121cf6.js";import"./Title.b0254e64.js";import"./Form.01134ed5.js";import"./router.330b5ee2.js";import"./index.30e21000.js";import"./index.d2e87b7c.js";import"./url.ba80c662.js";import"./index.a63dba09.js";import"./index.72042afd.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]="545075b7-9b3b-4573-afc3-20e52828d05d",o._sentryDebugIdIdentifier="sentry-dbid-545075b7-9b3b-4573-afc3-20e52828d05d")}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(()=>c.list()),s=({key:e})=>i.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=async()=>{const e=await c.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(()=>[l(" Jobs are exclusive to Cloud plans. Visit our "),T,l(" to learn more. ")]),_:1},8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Jobs.e13587d4.js.map
