From 497f970eac5ad9aae5acb69e08ed0f194a31e7b6 Mon Sep 17 00:00:00 2001 From: clayberF <49653677+clayberF@users.noreply.github.com> Date: Mon, 26 Oct 2026 10:16:43 -0300 Subject: [PATCH] PNI buttons show the monthly port fee next to the setup cost (#110) The buy buttons only showed the one-off setup (1500 + setup/2), so a $1.8k cross-connect read like a monthly bill, while the real monthly fee (PORT[i].pni) was shown nowhere. Reuse the existing translated '{port} {cost} + {mo}/mo' label, like transit and IX. --- CHANGELOG.md | 2 ++ site/index.html | 2 +- tests/issues.test.js | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04b01be..788ed53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ 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). + ## [1.30.0] — 2026-10-26 - Twelve Pacific islands join the map: Honolulu, Guam, Koror, Majuro, Port Moresby, Honiara, Nouméa, Suva, Nuku’alofa, Apia, Pago Pago and Papeete. The cables across the Pacific now stop where they really land, and a POP on an island splits a long crossing into shorter hops that each carry more: California to Sydney goes from 400G to 1.6T per wave via Honolulu and Suva, Hong Kong and Manila to Los Angeles from 400G to 800G via Guam, and Santiago to Sydney from 400G to 800G via Tahiti. Twelve new cables, among them SEA-US Later, Echo-Chamber and Coral Sea Shanty, link the islands, and the old ones gain island stops. Only islands with a real exchange today get one: Honolulu, Guam, Suva, Nouméa and Honiara. Island telcos from Hawaiian Telecombo to Never Too Atoll join the networks, PacNOG meets in Suva every December, Guam, Port Moresby and Honiara have unreliable power, Tonga’s cable has a volcano for a neighbour, and a new scenario, Stepping Stones, asks you to hop the Pacific at 1.6T. diff --git a/site/index.html b/site/index.html index 35f84e6..24f1daa 100644 --- a/site/index.html +++ b/site/index.html @@ -3371,7 +3371,7 @@ function cityPanel(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')}
`;} - else{h+=chk.ok?`
${PORT.map((P2,i)=>portShown(i)?btn(`${P2.n} ${fmt$(1500+P2.setup/2)}`,'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)}
`;} + 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.')}

`; for(const n of NETS.filter(n=>n.cache)){const have=S.caches.filter(x=>x.city===c&&x.net===n.id),dem=R.demTo[n.id]||0,ok=dem>=n.cache.min; diff --git a/tests/issues.test.js b/tests/issues.test.js index f01c581..b8697ce 100644 --- a/tests/issues.test.js +++ b/tests/issues.test.js @@ -1139,3 +1139,11 @@ test('#107 a bigger optic never carries less than a smaller one at the same dist assert.equal(ev("optMode('tp32',{km:7000,sub:true,regen:0}).g"), 1200); assert.deepEqual(errors, []); }); + +test('#110 PNI buttons show the monthly port fee, not just the one-off setup', () => { + const { ev, errors } = load(); + 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'); + assert.deepEqual(errors, []); +});