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.f8f8676d.js";import{e as x,a as v,b as I}from"./icons.c3170cf4.js";import{a as D}from"./asyncComputed.9c91cdf6.js";import{J as p}from"./jobs.0ffa7c0c.js";import{C as A}from"./CrudView.fe3c74bf.js";import{a as N}from"./ant-design.8ffd5ed0.js";import"./activeRecord.913921b5.js";import"./pubsub.8eddc628.js";import"./Text.7ab5366c.js";import"./Title.53d37289.js";import"./transButton.ca7603a2.js";import"./router.b4a342b4.js";import"./Form.2b1bb5d1.js";import"./index.878fa14a.js";import"./url.46c79102.js";import"./index.4c4e9bdd.js";import"./index.97771f01.js";import"./index.2ab0079e.js";import"./index.e041bc2d.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]="8ca1558a-e97f-4424-84db-fb8e6229bbb5",i._sentryDebugIdIdentifier="sentry-dbid-8ca1558a-e97f-4424-84db-fb8e6229bbb5")}catch{}})();const P=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)}`}),b=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()},m=async()=>{const e=await p.create();l({key:e.identifier})},u=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:b},{icon:I,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),w(A,{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:m},{warning:C(()=>[d(" Jobs are exclusive to Cloud plans. Visit our "),P,d(" to learn more. ")]),_:1},8,["loading","table"]))}});export{W as default};
//# sourceMappingURL=Jobs.df5d8c4a.js.map
