import{d as y,eA as g,G as _,b as h,c as w,w as C,u as J,aA as c,e as k}from"./outputWidgets.0ed3a637.js";import{e as x,d as v,a as I}from"./icons.8d5441dc.js";import{a as D}from"./asyncComputed.054ae312.js";import{J as p}from"./jobs.9dcc9702.js";import{C as A}from"./CrudView.931c84f7.js";import{a as N}from"./ant-design.b8da9ea1.js";import"./activeRecord.e0ef2424.js";import"./pubsub.5dd4605f.js";import"./Text.e89a9af1.js";import"./Base.69739fb7.js";import"./transButton.3ca23b61.js";import"./router.d8af0f7d.js";import"./Title.53f943d2.js";import"./index.230ffe19.js";import"./url.4f7be002.js";import"./index.0f5ee3e7.js";import"./index.feaa4503.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]="62e41feb-9bf3-41b9-965e-9a269ee3fd5d",i._sentryDebugIdIdentifier="sentry-dbid-62e41feb-9bf3-41b9-965e-9a269ee3fd5d")}catch{}})();const V=k("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),L=y({__name:"Jobs",setup(i){const a=g(),{loading:s,result:n,refetch:d}=D(()=>p.list()),l=({key:e})=>a.push({path:`/_editor/job/${encodeURIComponent(e)}`}),u=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()),d()},m=async()=>{const e=await p.create();l({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()),d())},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:l},{icon:v,label:"Duplicate",onClick:u},{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:m},{warning:C(()=>[c(" Jobs are exclusive to Cloud plans. Visit our "),V,c(" to learn more. ")]),_:1},8,["loading","table"]))}});export{L as default};
//# sourceMappingURL=Jobs.aadb6028.js.map
