Merge main (peering policy) into the split layout via port-branch
This commit is contained in:
commit
d0ba85ef8f
11 changed files with 90 additions and 9 deletions
|
|
@ -13,7 +13,7 @@ function ixBlock(c,multi){const city=ixCity(c),C=CITY[city],ix=ixName(c),X=XIXM[
|
|||
for(const x of ad)h+=`<div class="row"><div class="grow"><div class="nm">${esc(x.n)} <span class="tag paid">${tr('auto-enrolled')}</span></div><div class="meta">${esc(x.blurb)} · ${tr('{price}/mo',{price:fmt$(x.mo)})}</div></div>${btn(UI.confirm==='dk'+c+x.n?tr('Lose exclusive benefits?'):tr('Opt out'),'dkOptOut',{city:c,n:x.n},'ghost sm')}</div>`;}
|
||||
if(isRemote(c))h+=`<p class="note">${trn('Remote port via a reseller: 1.5× price, 80% usable, and {n} member here refuse remote peers.','Remote port via a reseller: 1.5× price, 80% usable, and {n} members here refuse remote peers.',ixMembers(c).filter(noRemote).length)}</p>`;
|
||||
if(mine){const f=S.myIx[c].fab|0,N=MYIX_FAB[f+1];h+=`<div class="kv"><span>${tr('Members paying you')}</span><b>${tr('{n} of up to {max} · {price}/mo',{n:S.myIx[c].members.length,max:myFab(c).max,price:fmt$(S.myIx[c].members.length*MYIX_FEE)})}</b></div>${N?`<div class="btns">${btn(N.lvl>lvl()?tr('{name} fabric <small>level {lv}</small>',{name:N.n,lv:N.lvl}):tr('Upgrade fabric to {name} <small>{cost} + {mo}/mo</small>',{name:N.n,cost:fmt$(N.cost),mo:fmt$(N.mo)}),'myIxUp',{city:c},'pink sm',N.lvl>lvl()||S.cash<N.cost)}</div><p class="note">${tr('A bigger fabric carries more traffic and has room for more members. Your router here still has to keep up.')}</p>`:'<p class="note">'+tr('Biggest fabric money can buy.')+'</p>'}`;}
|
||||
else h+=`<div class="btns">${PORT.map((P2,i)=>i>S.ixp[c]&&portShown(i)?btn(tr('Upgrade {port} <small>{price}</small>',{port:P2.n,price:portMo(ixPortMo(c,i)*((S.ixn||{})[c]||1))}),'buyIx',{city:c,tier:i},'sm',(!!S.pops[city]&&!portOk(city,i))||(!S.pops[city]&&i>1)):'').join('')}${S.pops[city]&&((S.ixn||{})[c]||1)<LAG_MAX?btn(tr('+ LAG member <small>{price}</small>',{price:portMo(ixPortMo(c,S.ixp[c]))}),'lagIx',{city:c,d:1},'sm',S.cash<ixPortMo(c,S.ixp[c])):''}${((S.ixn||{})[c]||1)>1?btn(tr('− member'),'lagIx',{city:c,d:-1},'ghost sm'):''}${btn(S.rs[c]?tr('Leave route server'):tr('Join route server'),'rs',{city:c},S.rs[c]?'ghost sm':'pink sm')}${btn(UI.confirm==='ix'+c?tr('Really leave?'):tr('Leave IX'),'cancelIx',{city:c},'ghost sm')}</div>`;
|
||||
else h+=`<div class="btns">${PORT.map((P2,i)=>i>S.ixp[c]&&portShown(i)?btn(tr('Upgrade {port} <small>{price}</small>',{port:P2.n,price:portMo(ixPortMo(c,i)*((S.ixn||{})[c]||1))}),'buyIx',{city:c,tier:i},'sm',(!!S.pops[city]&&!portOk(city,i))||(!S.pops[city]&&i>1)):'').join('')}${S.pops[city]&&((S.ixn||{})[c]||1)<LAG_MAX?btn(tr('+ LAG member <small>{price}</small>',{price:portMo(ixPortMo(c,S.ixp[c]))}),'lagIx',{city:c,d:1},'sm',S.cash<ixPortMo(c,S.ixp[c])):''}${((S.ixn||{})[c]||1)>1?btn(tr('− member'),'lagIx',{city:c,d:-1},'ghost sm'):''}${btn(S.rs[c]?tr('Leave route server'):tr('Join route server'),'rs',{city:c},S.rs[c]?'ghost sm':'pink sm')}${S.rs[c]&&ppol()!=='open'?`<span class="meta">${tr('Off while your peering policy is {pol}',{pol:tr(PPOL_N[ppol()])})}</span>`:''}${btn(UI.confirm==='ix'+c?tr('Really leave?'):tr('Leave IX'),'cancelIx',{city:c},'ghost sm')}</div>`;
|
||||
h+=`<div style="margin-top:8px">`;
|
||||
{const elig=mine?[]:ixMembers(c).filter(id=>!set.has(id)&&peerOk(id,'ix',c).ok);if(elig.length>1)h+=`<div class="btns">${btn(tr('Request all {n} willing peers',{n:elig.length}),'peerAll',{city:c},'pink sm')}</div>`;}
|
||||
for(const id of ixMembers(c).sort((a,b)=>NSH[b]-NSH[a])){const n=NET[id],on=set.has(id),viaRs=on&&!S.peers[id+'@'+c]&&!mine,chk=peerOk(id,'ix',c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue