import{d as y,ey as g,H as _,b as h,c as w,w as C,u as J,aI as l,e as k}from"./outputWidgets.a4629ff8.js";import{e as x,a as I,b as v}from"./icons.73bff2ab.js";import{a as D}from"./asyncComputed.fb8b9ba6.js";import{J as p}from"./jobs.51c1e4e4.js";import{C as N}from"./CrudView.a5b1a4eb.js";import{a as P}from"./ant-design.523e8417.js";import"./activeRecord.a2b7d343.js";import"./pubsub.25dc8c41.js";import"./Text.eb216708.js";import"./Title.cf2a531e.js";import"./Form.ab59726f.js";import"./router.ab2ac3ba.js";import"./index.339c7421.js";import"./url.d6a620b9.js";import"./index.874565bb.js";import"./index.48817ebe.js";import"./index.0f6dde5f.js";import"./index.46db6cb2.js";import"./index.56cfba6d.js";import"./index.fda4c602.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]="1a4c3a3f-c65f-4534-81c2-4d8deb91db18",i._sentryDebugIdIdentifier="sentry-dbid-1a4c3a3f-c65f-4534-81c2-4d8deb91db18")}catch{}})();const V=k("a",{href:"https://abstra.io/pricing",target:"_blank"},"Pricing page",-1),X=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 P("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:I,label:"Duplicate",onClick:m},{icon:v,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),w(N,{loading:J(s),title:"Python 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{X as default};
//# sourceMappingURL=Jobs.990daf39.js.map
