diff --git a/CHANGELOG.md b/CHANGELOG.md index 788ed53..e776b36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] -- PNI buttons now show the monthly port fee next to the one-off setup cost, like IX ports do, so a $1.8k cross-connect no longer looks like a monthly bill (#110). +- PNI buttons now show the monthly port fee next to the one-off setup cost, so a $1.8k cross-connect no longer looks like a monthly bill (#110). Upgrading a PNI shows what the bigger port costs per month too. ## [1.30.0] — 2026-10-26 diff --git a/site/i18n/it.js b/site/i18n/it.js index 47d9ec7..abf08ea 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -1464,8 +1464,6 @@ "{port} {cost} + {mo}/mo":"{port} {cost} + {mo}/mese", "Private interconnects (PNI)":"Interconnessioni private (PNI)", "A dedicated cross-connect to one network in {dc}. Needs more traffic than IX peering, but has its own capacity.":"Un cross-connect dedicato verso una sola rete in {dc}. Richiede più traffico del peering all’IX, ma ha una capacità tutta sua.", -"Upgrade all to {port} {cost}":"Porta tutte a {port} {cost}", -"Upgrade {port} {cost}":"Passa a {port} {cost}", "Really remove?":"Rimuovere davvero?", "Remove":"Rimuovi", "Paid peering: {price}/mo on top":"Peering a pagamento: {price}/mese in più", diff --git a/site/i18n/pt.js b/site/i18n/pt.js index b0f10d6..afa9e25 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -1463,8 +1463,6 @@ "{port} {cost} + {mo}/mo":"{port} {cost} + {mo}/mês", "Private interconnects (PNI)":"Interconexões privadas (PNI)", "A dedicated cross-connect to one network in {dc}. Needs more traffic than IX peering, but has its own capacity.":"Um cross-connect dedicado para uma única rede em {dc}. Exige mais tráfego que peering no IX, mas tem capacidade própria.", -"Upgrade all to {port} {cost}":"Upgrade de todas para {port} {cost}", -"Upgrade {port} {cost}":"Upgrade para {port} {cost}", "Really remove?":"Remover mesmo?", "Remove":"Remover", "Paid peering: {price}/mo on top":"Peering pago: {price}/mês a mais", diff --git a/site/index.html b/site/index.html index 24f1daa..a50fad3 100644 --- a/site/index.html +++ b/site/index.html @@ -3370,7 +3370,7 @@ function cityPanel(c){ const here=NETS.filter(n=>n.pops.includes(c)); for(const n of here){const pn=S.pni.find(x=>x.city===c&&x.net===n.id),chk=peerOk(n.id,'pni',c); h+=`
${logo(n)}
${esc(n.name)} ${n.pol}
`; - if(pn){const u=R.usePni[pn.id]||0,cap=lagCap(PORT[pn.tier].g,pn.n);h+=`
${(pn.n||1)>1?`${pn.n}×${PORT[pn.tier].n} LAG`:PORT[pn.tier].n} PNI${fmtG(u)}
${prefCtl('p',pn.id,pn.pref)}${siteCtl('p',pn.id,c,pn.site)}
${PORT.map((P2,i)=>i>pn.tier?btn((pn.n||1)>1?tr('Upgrade all to {port} {cost}',{port:P2.n,cost:fmt$((1500+P2.setup/2)*(pn.n||1))}):tr('Upgrade {port} {cost}',{port:P2.n,cost:fmt$((1500+P2.setup/2)*(pn.n||1))}),'pni',{city:c,net:n.id,tier:i},'sm',!portOk(c,i)||S.cash<(1500+P2.setup/2)*(pn.n||1)):'').join('')}${(pn.n||1){cost} + {mo}/mo',{cost:fmt$(1500+PORT[pn.tier].setup/2),mo:fmt$(PORT[pn.tier].pni)}),'lagP',{id:pn.id,d:1},'sm',S.cash<1500+PORT[pn.tier].setup/2):''}${(pn.n||1)>1?btn(tr('− member'),'lagP',{id:pn.id,d:-1},'ghost sm'):''}${NET[n.id].cn?btn(pn.sacrif?tr('Sacrificial choke ✓'):tr('Make sacrificial contains floods · ½ capacity'),'sacrif',{id:pn.id},pn.sacrif?'green sm':'sm'):''}${btn(UI.confirm===pn.id?tr('Really remove?'):tr('Remove'),'cancelPni',{id:pn.id},'ghost sm')}
`;} + if(pn){const u=R.usePni[pn.id]||0,cap=lagCap(PORT[pn.tier].g,pn.n);h+=`
${(pn.n||1)>1?`${pn.n}×${PORT[pn.tier].n} LAG`:PORT[pn.tier].n} PNI${fmtG(u)}
${prefCtl('p',pn.id,pn.pref)}${siteCtl('p',pn.id,c,pn.site)}
${PORT.map((P2,i)=>i>pn.tier?btn((a=>(pn.n||1)>1?tr('Upgrade all to {port} {cost} + {mo}/mo',a):tr('Upgrade {port} {cost} + {mo}/mo',a))({port:P2.n,cost:fmt$((1500+P2.setup/2)*(pn.n||1)),mo:fmt$(P2.pni*(pn.n||1))}),'pni',{city:c,net:n.id,tier:i},'sm',!portOk(c,i)||S.cash<(1500+P2.setup/2)*(pn.n||1)):'').join('')}${(pn.n||1){cost} + {mo}/mo',{cost:fmt$(1500+PORT[pn.tier].setup/2),mo:fmt$(PORT[pn.tier].pni)}),'lagP',{id:pn.id,d:1},'sm',S.cash<1500+PORT[pn.tier].setup/2):''}${(pn.n||1)>1?btn(tr('− member'),'lagP',{id:pn.id,d:-1},'ghost sm'):''}${NET[n.id].cn?btn(pn.sacrif?tr('Sacrificial choke ✓'):tr('Make sacrificial contains floods · ½ capacity'),'sacrif',{id:pn.id},pn.sacrif?'green sm':'sm'):''}${btn(UI.confirm===pn.id?tr('Really remove?'):tr('Remove'),'cancelPni',{id:pn.id},'ghost sm')}
`;} else{h+=chk.ok?`
${PORT.map((P2,i)=>portShown(i)?btn(tr('{port} {cost} + {mo}/mo',{port:P2.n,cost:fmt$(1500+P2.setup/2),mo:fmt$(P2.pni)}),'pni',{city:c,net:n.id,tier:i},'sm',S.cash<1500+P2.setup/2||!portOk(c,i)):'').join('')}
${chk.fee?`
${tr('Paid peering: {price}/mo on top',{price:fmt$(chk.fee)})}
`:''}`:`
${esc(chk.why)}
`;} h+=`
`;} h+=`

${tr('Embedded caches')}

${tr('CDNs put free cache servers inside your POP. Most of their traffic is then served right here, with no transit and no IX port.')}

`; @@ -3649,7 +3649,7 @@ function connUp(r){if(r.mine)return '';const nx=t=>PORT[t+1]&&portShown(t+1)?t+1 if(i>=0){const a={port:PORT[i].n,cost:fmt$(PORT[i].setup*n),mo:fmt$(PORT[i].tmo*n)};h+=btn(n>1?tr('Upgrade all to {port} {cost} + {mo}/mo',a):tr('Upgrade {port} {cost} + {mo}/mo',a),'buyTransit',{city:t.city,net:t.net,tier:i},'sm',S.cash{cost} + {mo}/mo',{cost:fmt$(PORT[t.tier].setup),mo:fmt$(PORT[t.tier].tmo)}),'lagT',{id:t.id,d:1},'sm',S.cashx.id===r.id);if(!p)return '';const n=p.n||1,i=nx(p.tier),c=i>=0?(1500+PORT[i].setup/2)*n:0; - if(i>=0){const a={port:PORT[i].n,cost:fmt$(c)};h+=btn(n>1?tr('Upgrade all to {port} {cost}',a):tr('Upgrade {port} {cost}',a),'pni',{city:p.city,net:p.net,tier:i},'sm',!portOk(p.city,i)||S.cash=0){const a={port:PORT[i].n,cost:fmt$(c),mo:fmt$(PORT[i].pni*n)};h+=btn(n>1?tr('Upgrade all to {port} {cost} + {mo}/mo',a):tr('Upgrade {port} {cost} + {mo}/mo',a),'pni',{city:p.city,net:p.net,tier:i},'sm',!portOk(p.city,i)||S.cash{cost} + {mo}/mo',{cost:fmt$(1500+PORT[p.tier].setup/2),mo:fmt$(PORT[p.tier].pni)}),'lagP',{id:p.id,d:1},'sm',S.cash<1500+PORT[p.tier].setup/2);} else if(r.k==='ix'){const c=r.id,city=ixCity(c),n=(S.ixn||{})[c]||1,i=nx(S.ixp[c]); if(i>=0)h+=btn(tr('Upgrade {port} {price}',{port:PORT[i].n,price:portMo(ixPortMo(c,i)*n)}),'buyIx',{city:c,tier:i},'sm',(!!S.pops[city]&&!portOk(city,i))||(!S.pops[city]&&i>1)); diff --git a/tests/issues.test.js b/tests/issues.test.js index b8697ce..67fadb9 100644 --- a/tests/issues.test.js +++ b/tests/issues.test.js @@ -1145,5 +1145,9 @@ test('#110 PNI buttons show the monthly port fee, not just the one-off setup', ( ev("ACT.start({});S.cash=1e9;S.lvl=6;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});selectCity('fra');ACT.tab({t:'peer'})"); const txt = ev("document.getElementById('panelBody').textContent"); assert.match(txt, /10G \$1\.8k \+ \$200\/mo/, 'setup plus the monthly fee, like IX ports and LAG members'); + // upgrading an existing PNI says what the bigger port costs per month too, in the panel and in the NOC's list + ev("const n=NETS.find(x=>x.pops.includes('fra')&&!x.tail&&peerOk(x.id,'pni','fra').ok);S.pni.push({id:'p1',net:n.id,city:'fra',tier:0,n:1});after();selectCity('fra');ACT.tab({t:'peer'})"); + assert.match(ev("document.getElementById('panelBody').textContent"), /Upgrade 100G \$2\.3k \+ \$350\/mo/); + assert.match(ev("connUp(conns().find(r=>r.k==='p'&&r.id==='p1')).replace(/<[^>]+>/g,'')"), /Upgrade 100G \$2\.3k \+ \$350\/mo/); assert.deepEqual(errors, []); });