import{d as f,eA as y,G as g,b as _,c as h,w,u as C,aq as c,e as J}from"./outputWidgets.e822ff0f.js";import{J as d}from"./jobs.0c9c4c4c.js";import{e as k,d as x}from"./icons.0ab0d55f.js";import{a as I}from"./asyncComputed.68870ff7.js";import{a as v}from"./ant-design.e2b10503.js";import{C as D}from"./CrudView.0a0ee0a6.js";import"./record.edca104e.js";import"./pubsub.ae710ef5.js";import"./transButton.f06af665.js";import"./Text.4c9d53a2.js";import"./Base.775de4d5.js";import"./router.8fbd98d9.js";import"./Title.5afb3003.js";import"./index.bf8163eb.js";import"./url.c786ab78.js";import"./index.eb9667df.js";import"./index.1b95bbbc.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]="eb4fa6c8-c3c1-490f-bb0f-a1d5278ee545",a._sentryDebugIdIdentifier="sentry-dbid-eb4fa6c8-c3c1-490f-bb0f-a1d5278ee545")}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(()=>d.list()),s=({key:e})=>n.push({path:`/_editor/job/${encodeURIComponent(e)}`}),m=async()=>{const e=await d.create();s({key:e.id})},p=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(b=>b.id===e))==null?void 0:t.delete()),l())},u=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:p,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:u.value,"entity-name":"Job",onCreate:m},{warning:w(()=>[c(" Jobs are exclusive to Cloud plans. Visit our "),N,c(" to learn more. ")]),_:1},8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Jobs.5b4e34b5.js.map
