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.a5fcf389.js";import{J as l}from"./jobs.191a9e78.js";import{e as k,d as x}from"./icons.1a1dc210.js";import{a as I}from"./asyncComputed.b7d3265e.js";import{a as v}from"./ant-design.35ff28ee.js";import{C as D}from"./CrudView.cee1047f.js";import"./record.e2e84f62.js";import"./pubsub.903f7e54.js";import"./transButton.fc314012.js";import"./Text.d2260f67.js";import"./Base.175f3ec4.js";import"./router.8a74f04b.js";import"./Title.42ad4bfb.js";import"./index.39083dd8.js";import"./url.d6641ded.js";import"./index.48f4731a.js";import"./index.5b7d1aca.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]="683d2db9-65de-4983-b2f0-6d4985064742",a._sentryDebugIdIdentifier="sentry-dbid-683d2db9-65de-4983-b2f0-6d4985064742")}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:c}=I(()=>l.list()),s=({key:e})=>n.push({path:`/_editor/job/${encodeURIComponent(e)}`}),m=async()=>{const e=await l.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()),c())},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(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),N,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Jobs.0c36534d.js.map
