import{d as f,eA as y,G as g,b as _,c as h,w,u as C,aq as d,e as J}from"./outputWidgets.e60ab380.js";import{J as c}from"./jobs.30740779.js";import{e as k,d as x}from"./icons.6c1915db.js";import{a as I}from"./asyncComputed.7ba647bd.js";import{a as v}from"./ant-design.dc5fef0a.js";import{C as D}from"./CrudView.a4f4d47c.js";import"./record.04c6d5a0.js";import"./pubsub.e6733ea4.js";import"./transButton.1b3f66c8.js";import"./Text.742cb8ec.js";import"./Base.0638c3f7.js";import"./router.0cf2e70d.js";import"./Title.666a14b1.js";import"./index.1462457d.js";import"./url.7bd60adc.js";import"./index.ed25df4f.js";import"./index.aaa1fe24.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="7668b22b-f2cd-41eb-b684-8bbd636dc018",a._sentryDebugIdIdentifier="sentry-dbid-7668b22b-f2cd-41eb-b684-8bbd636dc018")}catch{}})();const N=J("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),H=f({__name:"Jobs",setup(a){const n=y(),{loading:r,result:i,refetch:l}=I(()=>c.list()),s=({key:e})=>n.push({path:`/_editor/job/${encodeURIComponent(e)}`}),b=async()=>{const e=await c.create();s({key:e.id})},m=async({key:e})=>{var o,t;await v("Are you sure you want to delete this job?")&&(await((t=(o=i.value)==null?void 0:o.find(u=>u.id===e))==null?void 0:t.delete()),l())},p=g(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Schedule"},{name:"Actions",align:"right"}],rows:(o=(e=i.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/job/${encodeURIComponent(t.id)}`},{text:t.schedule},{text:"",actions:[{icon:k,label:"Edit Job",onClick:s},{icon:x,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(_(),h(D,{loading:C(r),title:"Jobs","create-button-text":"Create Job",description:"Schedule Python scripts like events on a calendar.","empty-title":"No jobs here yet",table:p.value,"entity-name":"Job",onCreate:b},{warning:w(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),N,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Jobs.a07a49cf.js.map
