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.04a14374.js";import{J as d}from"./jobs.e656e868.js";import{e as k,d as x}from"./icons.dee9dbe8.js";import{a as I}from"./asyncComputed.53598080.js";import{a as v}from"./ant-design.213d3e09.js";import{C as D}from"./CrudView.a6f509b7.js";import"./record.b64a41e6.js";import"./pubsub.bb759777.js";import"./transButton.772cc0ed.js";import"./Text.84d5ffc7.js";import"./Base.0c1843db.js";import"./router.4677d467.js";import"./Title.9beb186f.js";import"./index.5d9ba614.js";import"./url.311573c2.js";import"./index.9bdc1e6b.js";import"./index.90d3343e.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]="1fcb6673-1527-4467-8924-ef9cb87868c0",a._sentryDebugIdIdentifier="sentry-dbid-1fcb6673-1527-4467-8924-ef9cb87868c0")}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.0d258cd8.js.map
