import{d as C,a6 as N,S as n,U as _,V as c,k as h,u as f,o as T,_ as m,X as w,Z as o,G as p,F as H,a1 as k,Y as U,f as s,c as x,a9 as E,aa as M,a4 as O,a5 as $}from"./chunks/vendor-vue.BCDG_KVZ.js";import{t as D,_ as t,A as G,c as R,a as W}from"./chunks/AppHeader.D4x1A4Fm.js";import{h as X,T as Y,d as Z,_ as j,e as q}from"./chunks/vendor-antd.B2ASlZtA.js";const J=C({__name:"App",setup(S){return(r,u)=>{const l=N("router-view"),i=X;return n(),_(i,{theme:f(D)},{default:c(()=>[h(l)]),_:1},8,["theme"])}}}),K={class:"nimblymail-smtp-sites"},L={key:0},Q=["href"],P={class:"site-domain"},ee=C({__name:"SitesView",setup(S){const r=s(!1),u=s([]),l=s(0),i=s(1),d=s(50),I=x(()=>[{title:t("Site","nimblymail-smtp"),dataIndex:"name"},{title:t("Mailer","nimblymail-smtp"),dataIndex:"mailer",width:140},{title:t("Overrides","nimblymail-smtp"),dataIndex:"override_count",width:110},{title:t("Sent (24h)","nimblymail-smtp"),dataIndex:"sent_24h",width:110},{title:t("Failed (24h)","nimblymail-smtp"),dataIndex:"failed_24h",width:120},{title:"",dataIndex:"actions",width:120}]),V=x(()=>({current:i.value,pageSize:d.value,total:l.value,showSizeChanger:!0,pageSizeOptions:["25","50","100"]}));async function v(){r.value=!0;try{const{data:a}=await R.get("/network/sites",{params:{page:i.value,per_page:d.value}});u.value=a.sites,l.value=a.total}catch{q.error(t("Failed to load sites.","nimblymail-smtp"))}finally{r.value=!1}}function z(a){i.value=a.current??i.value,d.value=a.pageSize??d.value,v()}function A(a){const y=window.nimblymailSmtpApp?.adminUrl??"admin.php";window.location.href=y+"?page=nimblymail-smtp-network-site-settings&blog_id="+a.blog_id}return T(()=>{v()}),(a,y)=>{const b=Y,B=Z,F=j;return n(),m("div",K,[h(G,{title:f(t)("Sites","nimblymail-smtp")},null,8,["title"]),h(F,{"data-source":u.value,columns:I.value,"row-key":e=>e.blog_id,loading:r.value,pagination:V.value,onChange:z},{bodyCell:c(e=>[e.column.dataIndex==="name"?(n(),m("div",L,[w("a",{href:"//"+e.record.domain+e.record.path,target:"_blank",rel:"noopener"},o(e.record.name),9,Q),w("div",P,o(e.record.domain+e.record.path),1)])):e.column.dataIndex==="mailer"?(n(),_(b,{key:1},{default:c(()=>[p(o(e.record.mailer),1)]),_:2},1024)):e.column.dataIndex==="override_count"?(n(),m(H,{key:2},[e.record.override_count>0?(n(),_(b,{key:0,color:"orange"},{default:c(()=>[p(o(e.record.override_count),1)]),_:2},1024)):k("",!0)],64)):e.column.dataIndex==="failed_24h"?(n(),m("span",{key:3,class:U({"failed-count":e.record.failed_24h>0})},o(e.record.failed_24h),3)):e.column.dataIndex==="actions"?(n(),_(B,{key:4,size:"small",onClick:ie=>A(e.record)},{default:c(()=>[p(o(f(t)("Edit","nimblymail-smtp")),1)]),_:1},8,["onClick"])):k("",!0)]),_:1},8,["data-source","columns","row-key","loading","pagination"])])}}}),ae=W(ee,[["__scopeId","data-v-89f0ae9a"]]),te=[{path:"/",name:"sites",component:ae}],ne=E({history:M(),routes:te}),g=O(J);g.use($());g.use(ne);g.mount("#nimblymail-smtp-app");
//# sourceMappingURL=network-sites.BDhRvBqx.js.map
