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.df68f70a.js";import{J as c}from"./jobs.c31c15fe.js";import{e as k,d as x}from"./icons.6f0b428b.js";import{a as I}from"./asyncComputed.c4f3fa7a.js";import{a as v}from"./ant-design.4f24b7fc.js";import{C as D}from"./CrudView.8169c4b4.js";import"./record.493f7d84.js";import"./pubsub.26abae80.js";import"./transButton.b32cb3fc.js";import"./Text.5293eafa.js";import"./Base.8da1f136.js";import"./router.d34810ba.js";import"./Title.d7a9606c.js";import"./index.a1698b08.js";import"./url.e14018a7.js";import"./index.4c2136c4.js";import"./index.f12da0b9.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]="98cd9d4a-e1a7-498b-814d-b2ab7844b779",a._sentryDebugIdIdentifier="sentry-dbid-98cd9d4a-e1a7-498b-814d-b2ab7844b779")}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)}`}),m=async()=>{const e=await c.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(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),N,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Jobs.f898ccaf.js.map
