import{d as y,ey as g,H as _,b as h,c as w,w as C,u as J,aI as d,e as k}from"./outputWidgets.1cf78234.js";import{e as x,a as I,b as v}from"./icons.ba4d43de.js";import{a as D}from"./asyncComputed.513601fc.js";import{J as p}from"./jobs.451e8a5e.js";import{C as N}from"./CrudView.9f0a1020.js";import{a as P}from"./ant-design.b7f18845.js";import"./activeRecord.1ee4e98a.js";import"./pubsub.a66a61fd.js";import"./index.a7df5fa7.js";import"./Title.a8b8fdd6.js";import"./Form.5fb25f40.js";import"./router.4077f51e.js";import"./index.748edabf.js";import"./url.18ee0e18.js";import"./index.427c7dc5.js";import"./index.4f30f3fe.js";import"./index.960f4655.js";import"./index.7a53699a.js";import"./index.67188546.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]="d12516b3-8ffe-4a1e-9527-13c44969a46b",i._sentryDebugIdIdentifier="sentry-dbid-d12516b3-8ffe-4a1e-9527-13c44969a46b")}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()),l=({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();l({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:l},{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(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),V,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Jobs.7577bf65.js.map
