import{d as y,ey as g,G as _,b as h,c as w,w as C,u as J,aA as d,e as k}from"./outputWidgets.24bc53e6.js";import{e as x,a as v,b as I}from"./icons.346b8028.js";import{a as D}from"./asyncComputed.e4b96939.js";import{J as f}from"./jobs.7e4ad3f1.js";import{C as N}from"./CrudView.acebed42.js";import{a as P}from"./ant-design.3bddf1a0.js";import"./activeRecord.7f48ce0d.js";import"./pubsub.6b8c4d65.js";import"./Text.9efc0467.js";import"./Title.d959e45a.js";import"./transButton.082aab94.js";import"./router.5678fba5.js";import"./Form.026abd8d.js";import"./index.bf56aca1.js";import"./url.12ca99c5.js";import"./index.0ec384bd.js";import"./index.3a0ced65.js";import"./index.b19c9d88.js";import"./index.4b05c792.js";import"./index.d2b2175c.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]="e2fa3153-3974-4e33-be58-f9f5ff7dff2f",i._sentryDebugIdIdentifier="sentry-dbid-e2fa3153-3974-4e33-be58-f9f5ff7dff2f")}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:l}=D(()=>f.list()),c=({key:e})=>a.push({path:`/_editor/job/${encodeURIComponent(e)}`}),p=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()),l()},m=async()=>{const e=await f.create();c({key:e.identifier})},u=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()),l())},b=_(()=>{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:c},{icon:v,label:"Duplicate",onClick:p},{icon:I,label:"Delete",onClick:u,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:b.value,"entity-name":"Job",onCreate:m},{warning:C(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),V,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{X as default};
//# sourceMappingURL=Jobs.1fde5e40.js.map
