import{aA as C,b as s,M as B,d,q as k,o as S,_ as j}from"./app-QjDgb7aF.js";import{b as q,E as p,j as n,g as w,i as c,k as u,p as l,F,G as N,u as h,q as r,D as _,J as P,a as R,f as b}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const T={class:"status"},V={key:0,class:"ph-check ph-bold ph-lg icon accepted"},A={key:1,class:"ph-prohibit ph-bold ph-lg icon rejected"},D={key:2,class:"ph-clock ph-bold ph-lg icon requesting"},E=q({__name:"relays",setup(H){let m=R([]);async function y(){const{canceled:t,result:e}=await S({title:s.ts.addRelay,type:"url",placeholder:s.ts.inboxUrl});t||d("admin/relays/add",{inbox:e}).then(o=>{i()}).catch(o=>{k({type:"error",text:o.message||o})})}function f(t){d("admin/relays/remove",{inbox:t}).then(()=>{i()}).catch(e=>{k({type:"error",text:e.message||e})})}function i(){d("admin/relays/list").then(t=>{m.value=t})}i();const g=b(()=>[{asFullButton:!0,icon:"ph-plus ph-bold ph-lg",text:s.ts.addRelay,handler:y}]),x=b(()=>[]);return C({title:s.ts.relays,icon:"ph-arrows-merge ph-bold ph-lg"}),(t,e)=>{const o=p("MkPageHeader"),v=p("MkSpacer"),M=p("MkStickyContainer");return n(),w(M,null,{header:c(()=>[u(o,{actions:g.value,tabs:x.value,"display-back-button":!0},null,8,["actions","tabs"])]),default:c(()=>[u(v,{"content-max":800},{default:c(()=>[(n(!0),l(F,null,N(h(m),a=>(n(),l("div",{key:a.inbox,class:"relaycxt _panel _block",style:{padding:"16px"}},[r("div",null,_(a.inbox),1),r("div",T,[a.status==="accepted"?(n(),l("i",V)):a.status==="rejected"?(n(),l("i",A)):(n(),l("i",D)),r("span",null,_(h(s).t(`_relayStatus.${a.status}`)),1)]),u(B,{class:"button",inline:"",danger:"",onClick:$=>f(a.inbox)},{default:c(()=>[e[0]||(e[0]=r("i",{class:"ph-trash ph-bold ph-lg"},null,-1)),P(" "+_(h(s).ts.remove),1)]),_:1},8,["onClick"])]))),128))]),_:1})]),_:1})}}}),U=j(E,[["__scopeId","data-v-7bdfdc1e"]]);export{U as default};
//# sourceMappingURL=relays-9LJVDKVI.js.map
