import{d as y,eA as g,G as _,b as h,c as w,w as C,u as J,aA as d,e as k}from"./outputWidgets.427e9347.js";import{e as x,a as v,b as I}from"./icons.2a865956.js";import{a as D}from"./asyncComputed.32abd7c2.js";import{J as p}from"./jobs.00698289.js";import{C as A}from"./CrudView.22a93e62.js";import{a as N}from"./ant-design.484e81b9.js";import"./activeRecord.91f10272.js";import"./pubsub.9b59356e.js";import"./Text.31458a16.js";import"./Base.dbea8db9.js";import"./FormItem.e1548cef.js";import"./transButton.470f2fe6.js";import"./router.1a20c20c.js";import"./Title.213e158e.js";import"./index.e440fe17.js";import"./url.9044ee0d.js";import"./index.8fcd530b.js";import"./index.36e3a141.js";import"./index.3804082b.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]="b20d6ae6-4457-40ab-8aef-05fc616eb3b9",i._sentryDebugIdIdentifier="sentry-dbid-b20d6ae6-4457-40ab-8aef-05fc616eb3b9")}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 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:l},{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(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),V,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Jobs.cf762d8c.js.map
