import{d as y,eA as g,G as _,b as h,c as w,w as C,u as J,aA as l,e as k}from"./outputWidgets.562826ac.js";import{e as x,a as v,b as I}from"./icons.63405824.js";import{a as D}from"./asyncComputed.df2d9552.js";import{J as p}from"./jobs.8122e83b.js";import{C as A}from"./CrudView.6f7097f4.js";import{a as N}from"./ant-design.1ee2ab2c.js";import"./activeRecord.6bb1bd7f.js";import"./pubsub.7185b91b.js";import"./Text.712cfc26.js";import"./Base.bf8dc0b1.js";import"./FormItem.fc4e7da8.js";import"./transButton.17480f27.js";import"./router.e5ce2c0b.js";import"./Title.f7aaa881.js";import"./index.82606edc.js";import"./url.5a1383d2.js";import"./index.01bf1f2c.js";import"./index.583cd440.js";import"./index.9cdd1b35.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[a]="0cc197dc-de91-41cb-8f54-4d3712eed556",i._sentryDebugIdIdentifier="sentry-dbid-0cc197dc-de91-41cb-8f54-4d3712eed556")}catch{}})();const V=k("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),W=y({__name:"Jobs",setup(i){const a=g(),{loading:s,result:n,refetch:c}=D(()=>p.list()),d=({key:e})=>a.push({path:`/_editor/job/${encodeURIComponent(e)}`}),m=async({key:e})=>{var o,t;await((t=(o=n.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.duplicate()),c()},u=async()=>{const e=await p.create();d({key:e.identifier})},b=async({key:e})=>{var o,t;await N("Are you sure you want to delete this job?")&&(await((t=(o=n.value)==null?void 0:o.find(r=>r.identifier===e))==null?void 0:t.delete()),c())},f=_(()=>{var e,o;return{columns:[{name:"Job Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.value)==null?void 0:e.map(t=>({key:t.identifier,cells:[{text:t.title,link:`/_editor/job/${encodeURIComponent(t.identifier)}`},{text:t.identifier},{text:"",actions:[{icon:x,label:"Edit Job",onClick:d},{icon:v,label:"Duplicate",onClick:m},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),w(A,{loading:J(s),title:"Jobs","create-button-text":"Create Job",description:"Schedule Python scripts like events on a calendar.","empty-title":"No jobs here yet",table:f.value,"entity-name":"Job",onCreate:u},{warning:C(()=>[l(" Jobs are exclusive to Cloud plans. Visit our "),V,l(" to learn more. ")]),_:1},8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Jobs.fe5f0783.js.map
