PNI list: status chips, value line, worth-it tag, filters and groups by type (#175, #172)

This commit is contained in:
Frederic Jung 2026-10-29 19:07:44 +01:00
parent 2699634e0f
commit d48fdbf2e5
No known key found for this signature in database
13 changed files with 217 additions and 10 deletions

View file

@ -2843,6 +2843,34 @@
"pni_all.pni_size":"PNI-Größe",
"pni_all.setup_total":"Einrichtung gesamt",
"pni_all.traffic_charges_apply":"Dazu kommen Traffic-Gebühren von {price} pro Gbps.",
"pni_list.chip_not_reached":"Nicht erreichbar",
"pni_list.chip_peers_at":"Peering an {list}",
"pni_list.chip_pni_at":"PNI in {list}",
"pni_list.chip_pni_elsewhere":"PNI woanders: {list}",
"pni_list.chip_pni_here":"PNI hier · {port} · {p}",
"pni_list.chip_pni_here_on_order":"PNI hier · bestellt",
"pni_list.chip_via_a_cone":"Über den Cone eines Peers",
"pni_list.chip_via_cone":"Über den Cone von {net}",
"pni_list.chip_via_transit":"Über Transit",
"pni_list.f_all":"Alle",
"pni_list.f_pni":"Schon PNI",
"pni_list.f_transit":"Über Transit",
"pni_list.f_worth":"Lohnt sich",
"pni_list.list_more":"{list} +{n}",
"pni_list.little_to_gain_here":"Hier gibt's wenig zu holen: {g}",
"pni_list.n_here":"{g} hier",
"pni_list.n_networks_w_worth_it":{"one":"{n} Netz · {w} lohnt sich","other":"{n} Netze · {w} lohnen sich"},
"pni_list.nothing_matches":"Kein Netz hier passt zu diesem Filter.",
"pni_list.saves_minus_cost":"Spart {saved} Transit im Monat; der PNI kostet {cost} im Monat.",
"pni_list.sort_az":"Sortierung: A–Z",
"pni_list.sort_worth":"Sortierung: lohnende zuerst",
"pni_list.via_drop":"{g} verworfen",
"pni_list.via_haul":"{g} über den Backbone",
"pni_list.via_ix":"{g} IX",
"pni_list.via_transit":"{g} Transit",
"pni_list.with_port":"{port}-PNI: {val}",
"pni_list.worth_it":"Lohnt sich",
"pni_list.worth_rule":"⭐ Lohnt sich: Ein PNI hier spart mehr Transit, als er im Monat kostet, trägt mindestens 1 Gbps, die du heute verwirfst, oder nimmt mindestens 1 Gbps von einem Exchange-Port, der zu 80 % voll ist.",
"pnis.a_new_region_is_coming_online":"Eine neue Region geht bald online. Sie geht seit 2019 bald online.",
"pnis.about_n_days_to_go_nothing":"Noch etwa {n} Tage. Nichts zu tun außer warten oder nachhaken.",
"pnis.augment_with_net_delivered_in_city":"<b>Erweiterung mit {net} in {city} geliefert.</b><br>Jetzt {port}.",

View file

@ -2841,6 +2841,34 @@
"pni_all.pni_size":"Capacidad del PNI",
"pni_all.setup_total":"Coste total de instalación",
"pni_all.traffic_charges_apply":"También se aplican cargos de tráfico de {price} por Gbps.",
"pni_list.chip_not_reached":"Sin alcance",
"pni_list.chip_peers_at":"Peering en {list}",
"pni_list.chip_pni_at":"PNI en {list}",
"pni_list.chip_pni_elsewhere":"PNI en otro sitio: {list}",
"pni_list.chip_pni_here":"PNI aquí · {port} · {p}",
"pni_list.chip_pni_here_on_order":"PNI aquí · pedido",
"pni_list.chip_via_a_cone":"Por el cono de un peer",
"pni_list.chip_via_cone":"Por el cono de {net}",
"pni_list.chip_via_transit":"Por tránsito",
"pni_list.f_all":"Todas",
"pni_list.f_pni":"Ya con PNI",
"pni_list.f_transit":"Por tránsito",
"pni_list.f_worth":"Merece la pena",
"pni_list.list_more":"{list} +{n}",
"pni_list.little_to_gain_here":"Poco que ganar aquí: {g}",
"pni_list.n_here":"{g} aquí",
"pni_list.n_networks_w_worth_it":{"one":"{n} red · {w} merecen la pena","other":"{n} redes · {w} merecen la pena"},
"pni_list.nothing_matches":"Ninguna red de aquí coincide con este filtro.",
"pni_list.saves_minus_cost":"Ahorra {saved} de tránsito al mes; el PNI cuesta {cost} al mes.",
"pni_list.sort_az":"Orden: A–Z",
"pni_list.sort_worth":"Orden: las que merecen la pena primero",
"pni_list.via_drop":"{g} descartados",
"pni_list.via_haul":"{g} por el backbone",
"pni_list.via_ix":"{g} IX",
"pni_list.via_transit":"{g} tránsito",
"pni_list.with_port":"PNI de {port}: {val}",
"pni_list.worth_it":"Merece la pena",
"pni_list.worth_rule":"⭐ Merece la pena: un PNI aquí ahorra más tránsito del que cuesta al mes, lleva al menos 1 Gbps que hoy descartas, o quita al menos 1 Gbps de un puerto de exchange lleno al 80 %.",
"pnis.a_new_region_is_coming_online":"Pronto se pondrá en marcha una región nueva. Lleva poniéndose en marcha pronto desde 2019.",
"pnis.about_n_days_to_go_nothing":"Faltan unos {n} días. No queda más que esperar, o perseguirlo.",
"pnis.augment_with_net_delivered_in_city":"<b>Ampliación con {net} entregada en {city}.</b><br>Ahora {port}.",

View file

@ -2841,6 +2841,34 @@
"pni_all.pni_size":"Capacité du PNI",
"pni_all.setup_total":"Coût total d'installation",
"pni_all.traffic_charges_apply":"Des frais de trafic de {price} par Gbps s'appliquent également.",
"pni_list.chip_not_reached":"Non joignable",
"pni_list.chip_peers_at":"Peering à {list}",
"pni_list.chip_pni_at":"PNI à {list}",
"pni_list.chip_pni_elsewhere":"PNI ailleurs : {list}",
"pni_list.chip_pni_here":"PNI ici · {port} · {p}",
"pni_list.chip_pni_here_on_order":"PNI ici · en commande",
"pni_list.chip_via_a_cone":"Via le cône d'un peer",
"pni_list.chip_via_cone":"Via le cône de {net}",
"pni_list.chip_via_transit":"Via le transit",
"pni_list.f_all":"Tous",
"pni_list.f_pni":"Déjà en PNI",
"pni_list.f_transit":"Via le transit",
"pni_list.f_worth":"Rentable",
"pni_list.list_more":"{list} +{n}",
"pni_list.little_to_gain_here":"Peu à gagner ici : {g}",
"pni_list.n_here":"{g} ici",
"pni_list.n_networks_w_worth_it":{"one":"{n} réseau · {w} rentable(s)","other":"{n} réseaux · {w} rentable(s)"},
"pni_list.nothing_matches":"Aucun réseau ici ne correspond à ce filtre.",
"pni_list.saves_minus_cost":"Économise {saved} de transit par mois ; le PNI coûte {cost} par mois.",
"pni_list.sort_az":"Tri : A–Z",
"pni_list.sort_worth":"Tri : les rentables d'abord",
"pni_list.via_drop":"{g} perdus",
"pni_list.via_haul":"{g} par le backbone",
"pni_list.via_ix":"{g} IX",
"pni_list.via_transit":"{g} transit",
"pni_list.with_port":"PNI {port} : {val}",
"pni_list.worth_it":"Rentable",
"pni_list.worth_rule":"⭐ Rentable : un PNI ici économise plus de transit qu'il ne coûte par mois, transporte au moins 1 Gbps que tu perds aujourd'hui, ou retire au moins 1 Gbps d'un port d'exchange rempli à 80 %.",
"pnis.a_new_region_is_coming_online":"Une nouvelle région arrive bientôt. Elle arrive bientôt depuis 2019.",
"pnis.about_n_days_to_go_nothing":"Encore environ {n} jours. Rien à faire qu’attendre, ou relancer.",
"pnis.augment_with_net_delivered_in_city":"<b>Extension avec {net} livrée à {city}.</b><br>Désormais {port}.",

View file

@ -2841,6 +2841,34 @@
"pni_all.pni_size":"Capacità PNI",
"pni_all.setup_total":"Costo totale di attivazione",
"pni_all.traffic_charges_apply":"Si applicano anche costi di traffico di {price} per Gbps.",
"pni_list.chip_not_reached":"Non raggiunta",
"pni_list.chip_peers_at":"Peering a {list}",
"pni_list.chip_pni_at":"PNI a {list}",
"pni_list.chip_pni_elsewhere":"PNI altrove: {list}",
"pni_list.chip_pni_here":"PNI qui · {port} · {p}",
"pni_list.chip_pni_here_on_order":"PNI qui · ordinato",
"pni_list.chip_via_a_cone":"Tramite il cono di un peer",
"pni_list.chip_via_cone":"Tramite il cono di {net}",
"pni_list.chip_via_transit":"Tramite transit",
"pni_list.f_all":"Tutte",
"pni_list.f_pni":"Già in PNI",
"pni_list.f_transit":"Tramite transit",
"pni_list.f_worth":"Conviene",
"pni_list.list_more":"{list} +{n}",
"pni_list.little_to_gain_here":"Poco da guadagnare qui: {g}",
"pni_list.n_here":"{g} qui",
"pni_list.n_networks_w_worth_it":{"one":"{n} rete · {w} conviene","other":"{n} reti · {w} convengono"},
"pni_list.nothing_matches":"Nessuna rete qui corrisponde a questo filtro.",
"pni_list.saves_minus_cost":"Risparmi {saved} di transit al mese; il PNI costa {cost} al mese.",
"pni_list.sort_az":"Ordine: A–Z",
"pni_list.sort_worth":"Ordine: prima quelle che convengono",
"pni_list.via_drop":"{g} persi",
"pni_list.via_haul":"{g} sul backbone",
"pni_list.via_ix":"{g} IX",
"pni_list.via_transit":"{g} transit",
"pni_list.with_port":"PNI da {port}: {val}",
"pni_list.worth_it":"Conviene",
"pni_list.worth_rule":"⭐ Conviene: un PNI qui ti fa risparmiare più transit di quanto costa al mese, porta almeno 1 Gbps che oggi perdi, oppure toglie almeno 1 Gbps da una porta di exchange piena all'80%.",
"pnis.a_new_region_is_coming_online":"Una nuova region arriverà presto. Arriva presto dal 2019.",
"pnis.about_n_days_to_go_nothing":"Mancano circa {n} giorni. Non resta che aspettare, o sollecitare.",
"pnis.augment_with_net_delivered_in_city":"<b>Ampliamento con {net} consegnato a {city}.</b><br>Ora {port}.",

View file

@ -2841,6 +2841,34 @@
"pni_all.pni_size":"Capacidade do PNI",
"pni_all.setup_total":"Custo total de instalação",
"pni_all.traffic_charges_apply":"Também se aplicam custos de tráfego de {price} por Gbps.",
"pni_list.chip_not_reached":"Sem alcance",
"pni_list.chip_peers_at":"Peering em {list}",
"pni_list.chip_pni_at":"PNI em {list}",
"pni_list.chip_pni_elsewhere":"PNI noutro sítio: {list}",
"pni_list.chip_pni_here":"PNI aqui · {port} · {p}",
"pni_list.chip_pni_here_on_order":"PNI aqui · encomendado",
"pni_list.chip_via_a_cone":"Pelo cone de um peer",
"pni_list.chip_via_cone":"Pelo cone de {net}",
"pni_list.chip_via_transit":"Por trânsito",
"pni_list.f_all":"Todas",
"pni_list.f_pni":"Já com PNI",
"pni_list.f_transit":"Por trânsito",
"pni_list.f_worth":"Compensa",
"pni_list.list_more":"{list} +{n}",
"pni_list.little_to_gain_here":"Pouco a ganhar aqui: {g}",
"pni_list.n_here":"{g} aqui",
"pni_list.n_networks_w_worth_it":{"one":"{n} rede · {w} compensam","other":"{n} redes · {w} compensam"},
"pni_list.nothing_matches":"Nenhuma rede aqui corresponde a este filtro.",
"pni_list.saves_minus_cost":"Poupa {saved} de trânsito por mês; o PNI custa {cost} por mês.",
"pni_list.sort_az":"Ordem: A–Z",
"pni_list.sort_worth":"Ordem: as que compensam primeiro",
"pni_list.via_drop":"{g} perdidos",
"pni_list.via_haul":"{g} pelo backbone",
"pni_list.via_ix":"{g} IX",
"pni_list.via_transit":"{g} trânsito",
"pni_list.with_port":"PNI de {port}: {val}",
"pni_list.worth_it":"Compensa",
"pni_list.worth_rule":"⭐ Compensa: um PNI aqui poupa mais trânsito do que custa por mês, leva pelo menos 1 Gbps que hoje perdes, ou tira pelo menos 1 Gbps de uma porta de exchange cheia a 80%.",
"pnis.a_new_region_is_coming_online":"Uma nova região vai entrar no ar em breve. Ela está entrando no ar em breve desde 2019.",
"pnis.about_n_days_to_go_nothing":"Faltam cerca de {n} dias. Não há nada a fazer além de esperar, ou cobrar.",
"pnis.augment_with_net_delivered_in_city":"<b>Ampliação com {net} entregue em {city}.</b><br>Agora {port}.",

View file

@ -0,0 +1,6 @@
// The PNI list's filter, sort and folded groups (#175, #172): view state only, never saved.
Object.assign(ACT,{
pniFilter:({f})=>{UI.pniF=['all','t','worth','pni'].includes(f)?f:'all';listReset('pni');renderPanel();},
pniGrp:({g,o})=>{if(!PNI_GRP.includes(g))return;UI.pniOpen=UI.pniOpen||{};UI.pniOpen[g]=!!o;renderPanel();},
pniSort:()=>{UI.pniSort=UI.pniSort==='az'?'worth':'az';renderPanel();},
});

View file

@ -1,6 +1,6 @@
Object.assign(ACT,{
custGo:({id})=>{const b=S.biz.find(x=>x.id===id);if(!b)return;$('dash').hidden=true;ACT.focusCity({city:b.city});UI.tab='cust';renderPanel();},
listMore:({k})=>{if(k!=='conn'&&k!=='cust'&&k!=='nets')return;UI.listN=UI.listN||{};UI.listN[k]=listN(k)+LIST_PAGE;if(k==='nets'){renderLeft();return;}renderDash();},
listMore:({k})=>{if(k!=='conn'&&k!=='cust'&&k!=='nets'&&k!=='pni')return;UI.listN=UI.listN||{};UI.listN[k]=listN(k)+LIST_PAGE;if(k==='nets'){renderLeft();return;}if(k==='pni'){renderPanel();return;}renderDash();},
custF:({v})=>{UI.kf=UI.kf||{};UI.kf.f=v==='sad'?'sad':'';listReset('cust');renderDash();},
custCity:({v})=>{UI.kf=UI.kf||{};UI.kf.city=isCity(v)?v:'';listReset('cust');renderDash();},
custSort:({k})=>{if(!['mood','mo','name','city'].includes(k))return;listReset('cust');if(UI.custSort===k)UI.custDir=-(UI.custDir||1);else{UI.custSort=k;UI.custDir=k==='mo'?-1:1;}renderDash();},

View file

@ -82,7 +82,7 @@ function renderLeft(){checkLayer();
// Shown 100 at a time like the dashboard lists: every country's own eyeballs made this list long (2.0).
const nl=(foc?[foc]:out?ntLost():NETS).filter(n=>!n.tail||UI.tailOpen||foc||out);
for(const n of nl.slice(0,listN('nets'))){
h+=`<div class="row">${logo(n)}<div class="grow"><div class="nm">${esc(n.name)} <span class="meta">AS${n.asn}</span></div><div class="meta"><span class="tag ${n.type}">${TYPE_L[n.type]}</span> <span class="tag ${n.pol}">${n.pol}</span> · ${tr('hud_and_panels.p_of_traffic',{p:(NSH[n.id]*100).toFixed(1)})}${n.price?` · ${tr('hud_and_panels.transit_price_gbps',{price:(n.price*S.priceMul).toFixed(2)})}`:''}</div><div class="meta">${esc(n.blurb)}</div>${netWhere(n,where)}${(foc||out)&&!R.nt[n.id]?`<p class="why">${esc(offTransitHint(n.id))}</p>`:''}${(foc||out)&&coneVia(n.id)&&(R.cone[n.id]||!R.nt[n.id])?`<p class="meta">${R.cone[n.id]?tr('hud_and_panels.reached_through_the_customer_cone_of',{net:esc((NET[R.cone[n.id]]||coneVia(n.id)).name)}):tr('hud_and_panels.buys_transit_from_net_peer_with',{net:esc(coneVia(n.id).name)})}</p>`:''}${foc||out&&!R.nt[n.id]?meetLine(n,foc?24:4):''}</div></div>`;}
h+=`<div class="row">${logo(n)}<div class="grow"><div class="nm">${esc(n.name)} <span class="meta">AS${n.asn}</span></div><div class="meta"><span class="tag ${n.type}">${TYPE_L[n.type]}</span> <span class="tag ${n.pol}">${n.pol}</span> · ${tr('hud_and_panels.p_of_traffic',{p:(NSH[n.id]*100).toFixed(1)})}${n.price?` · ${tr('hud_and_panels.transit_price_gbps',{price:(n.price*S.priceMul).toFixed(2)})}`:''}</div><div class="pchips">${pniChip(n.id,null)}</div><div class="meta">${esc(n.blurb)}</div>${netWhere(n,where)}${(foc||out)&&!R.nt[n.id]?`<p class="why">${esc(offTransitHint(n.id))}</p>`:''}${(foc||out)&&coneVia(n.id)&&(R.cone[n.id]||!R.nt[n.id])?`<p class="meta">${R.cone[n.id]?tr('hud_and_panels.reached_through_the_customer_cone_of',{net:esc((NET[R.cone[n.id]]||coneVia(n.id)).name)}):tr('hud_and_panels.buys_transit_from_net_peer_with',{net:esc(coneVia(n.id).name)})}</p>`:''}${foc||out&&!R.nt[n.id]?meetLine(n,foc?24:4):''}</div></div>`;}
h+=listMore('nets',nl.length,n=>trn('hud_and_panels.n_more_networks',n));
if(!foc&&!out)h+=`<div class="row"><div class="grow"><div class="nm">${tr('hud_and_panels.the_long_tail')} <span class="meta">${tr('hud_and_panels.n_small_networks',{n:tl.length})}</span></div><div class="meta">${tr('hud_and_panels.p_of_traffic_between_them_scattered',{p:(tl.reduce((a,n)=>a+NSH[n.id],0)*100).toFixed(1),n:tlOn})}</div></div>${btn(UI.tailOpen?tr('common.hide'):tr('common.show'),'tailTog',{},'ghost sm')}</div>`;
}

View file

@ -54,13 +54,7 @@ function cityPanel(c){
h+=portNote(c);
h+=ixSection(c);
h+=`<section><h3>${tr('city_panel.private_interconnects_pni')}</h3><p class="lead">${tr('city_panel.a_dedicated_cross_connect_to_one',{dc:esc(siteName(c,'a'))})}</p>`;
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+=`<div class="row">${logo(n)}<div class="grow"><div class="nm">${esc(n.name)} <span class="tag ${n.pol}">${n.pol}</span></div>`;
if(pn&&!pniOn(pn))h+=pniWait(pn,c);
else if(pn){const u=R.usePni[pn.id]||0,cap=lagCap(pniG(pn),pn.n);h+=`<div class="kv"><span>${(pn.n||1)>1?`${pn.n}×${pniPN(pn)} LAG`:pniPN(pn)} PNI</span><b>${fmtG(u)}</b></div>${pn.up?`<div class="meta">${tr('city_panel.augment_on_order_port_about_n',{port:(pn.up.n>1?pn.up.n+'×':'')+(pn.up.g1?'1G':PORT[pn.up.tier].n),n:Math.max(0,pn.up.ready-S.day)})} ${btn(tr('common.chase_it'),'pniChase',{id:pn.id},'ghost sm')}</div>`:''}<div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('p',pn.id,pn.pref)}${siteCtl('p',pn.id,c,pn.site)}<div class="btns">${PORT.map((P2,i)=>!pn.up&&!msfNope(n.id,c)&&(i>pn.tier||(pn.g1&&i===0))?btn((a=>(pn.n||1)>1?tr('common.upgrade_all_to_port_cost_mo',a):tr('common.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)<LAG_MAX&&!pn.up&&!msfNope(n.id,c)?btn(tr('common.lag_member_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('common.member'),'lagP',{id:pn.id,d:-1},'ghost sm'):''}${NET[n.id].cn?btn(pn.sacrif?tr('common.sacrificial_choke'):tr('city_panel.make_sacrificial_contains_floods_1_2'),'sacrif',{id:pn.id},pn.sacrif?'green sm':'sm'):''}${btn(UI.confirm===pn.id?tr('common.really_remove'):tr('common.remove'),'cancelPni',{id:pn.id},'ghost sm')}</div>`;}
else{h+=chk.ok?`<div class="btns">${pniG1(n.id)?btn(tr('city_panel.port_cost_mo_mo',{port:'1G',cost:fmt$(PNI_G1_COST),mo:fmt$(Math.round(PORT[0].pni/2))}),'pni',{city:c,net:n.id,tier:-1},'sm',S.cash<PNI_G1_COST||!portOk(c,0)):''}${PORT.map((P2,i)=>portShown(i)&&i>=pniMin(n.id)?btn(tr('city_panel.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('')}</div><div class="meta">${pniEta(n.id)}${pniMin(n.id)?' · '+tr('city_panel.no_10g_net_starts_at_100g',{net:esc(n.name)}):pniG1(n.id)?' · '+tr('city_panel.sells_pnis_down_to_1g'):''}</div>${chk.fee?`<div class="meta">${tr('city_panel.paid_peering_price_mo_on_top',{price:fmt$(chk.fee)})}</div>`:''}`:`<div class="why">${esc(chk.why)}</div>`;}
h+=`</div></div>`;}
h+=pniListHtml(c);
h+=`</section><section><h3>${tr('common.embedded_caches')}</h3><p class="lead">${tr('city_panel.cdns_put_free_cache_servers_inside')}</p>`;
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;
h+=`<div class="row">${logo(n)}<div class="grow"><div class="nm">${esc(n.cache.name)}</div><div class="meta">${tr('common.from_net',{net:esc(n.name)})} · ${have.length?`${trn('common.n_box',have.length)} · ${tr('city_panel.serving_v',{v:fmtG(have.reduce((a,x)=>a+(R.useCache[x.id]||0),0))})}`:tr('city_panel.100g_per_box')}</div>${!ok?`<div class="why">${tr('city_panel.needs_min_gbps_of_traffic_to',{min:n.cache.min,net:esc(n.name),now:dem.toFixed(1)})}</div>`:''}</div>

View file

@ -0,0 +1,30 @@
/* ---------- The PNI list of a POP (#175, #172) ----------
Every network here answers three questions: how you reach it today (one chip), whether a PNI here is worth it
(a value line from live routing) and whether you can get one (the order buttons, policy and lead time). Sorted by
monthly value, filtered, grouped by type; groups with nothing to do (no PNI there, nothing you could order that moves 1 Gbps) stay folded. */
const PNI_GRP=['t1','t2','eye','cdn','paid'],pniGrpOf=n=>n.pol==='paid'?'paid':n.type;
const pniGrpL=k=>k==='paid'?tr('ops.p_paid'):TYPE_L[k];
function pniValLine(n,c,v){
if(v.g<1)return `<div class="meta pval">${tr('pni_list.little_to_gain_here',{g:fmtG(v.want)})}</div>`;
const via=[v.t>=0.05?tr('pni_list.via_transit',{g:fmtG(v.t)}):'',v.ix>=0.05?tr('pni_list.via_ix',{g:fmtG(v.ix)}):'',v.p>=0.05?tr('pni_list.via_haul',{g:fmtG(v.p)}):'',v.u>=0.05?tr('pni_list.via_drop',{g:fmtG(v.u)}):''].filter(Boolean).join(' · ');
const val=(v.val>0?'+':'')+tr('common.price_mo',{price:fmt$(Math.round(v.val))});
return `<div class="meta pval" title="${esc(tr('pni_list.saves_minus_cost',{saved:fmt$(Math.round(v.saved)),cost:fmt$(Math.round(v.cost))}))}">${tr('pni_list.n_here',{g:fmtG(v.want)})}: ${via} → ${tr('pni_list.with_port',{port:PORT[v.tier].n,val})}</div>`;}
function pniRow(c,n,pn,v,chk){let h=`<div class="row prow">${logo(n)}<div class="grow"><div class="nm">${esc(n.name)} <span class="tag ${n.pol}">${n.pol}</span>${v&&v.worth?` <span class="tag worth">⭐ ${tr('pni_list.worth_it')}</span>`:''}</div><div class="pchips">${pniChip(n.id,c)}</div>${v?pniValLine(n,c,v):''}`;
if(pn&&!pniOn(pn))h+=pniWait(pn,c);
else if(pn){const u=R.usePni[pn.id]||0,cap=lagCap(pniG(pn),pn.n);h+=`<div class="kv"><span>${(pn.n||1)>1?`${pn.n}×${pniPN(pn)} LAG`:pniPN(pn)} PNI</span><b>${fmtG(u)}</b></div>${pn.up?`<div class="meta">${tr('city_panel.augment_on_order_port_about_n',{port:(pn.up.n>1?pn.up.n+'×':'')+(pn.up.g1?'1G':PORT[pn.up.tier].n),n:Math.max(0,pn.up.ready-S.day)})} ${btn(tr('common.chase_it'),'pniChase',{id:pn.id},'ghost sm')}</div>`:''}<div class="bar ${barCls(u/cap)}"><i style="width:${u/cap*100}%"></i></div>${prefCtl('p',pn.id,pn.pref)}${siteCtl('p',pn.id,c,pn.site)}<div class="btns">${PORT.map((P2,i)=>!pn.up&&!msfNope(n.id,c)&&(i>pn.tier||(pn.g1&&i===0))?btn((a=>(pn.n||1)>1?tr('common.upgrade_all_to_port_cost_mo',a):tr('common.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)<LAG_MAX&&!pn.up&&!msfNope(n.id,c)?btn(tr('common.lag_member_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('common.member'),'lagP',{id:pn.id,d:-1},'ghost sm'):''}${NET[n.id].cn?btn(pn.sacrif?tr('common.sacrificial_choke'):tr('city_panel.make_sacrificial_contains_floods_1_2'),'sacrif',{id:pn.id},pn.sacrif?'green sm':'sm'):''}${btn(UI.confirm===pn.id?tr('common.really_remove'):tr('common.remove'),'cancelPni',{id:pn.id},'ghost sm')}</div>`;}
else{h+=chk.ok?`<div class="btns">${pniG1(n.id)?btn(tr('city_panel.port_cost_mo_mo',{port:'1G',cost:fmt$(PNI_G1_COST),mo:fmt$(Math.round(PORT[0].pni/2))}),'pni',{city:c,net:n.id,tier:-1},'sm',S.cash<PNI_G1_COST||!portOk(c,0)):''}${PORT.map((P2,i)=>portShown(i)&&i>=pniMin(n.id)?btn(tr('city_panel.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('')}</div><div class="meta">${pniEta(n.id)}${pniMin(n.id)?' · '+tr('city_panel.no_10g_net_starts_at_100g',{net:esc(n.name)}):pniG1(n.id)?' · '+tr('city_panel.sells_pnis_down_to_1g'):''}</div>${chk.fee?`<div class="meta">${tr('city_panel.paid_peering_price_mo_on_top',{price:fmt$(chk.fee)})}</div>`:''}`:`<div class="why">${esc(chk.why)}</div>`;}
return h+`</div></div>`;}
function pniListHtml(c){const f=UI.pniF||'all',az=UI.pniSort==='az',open=UI.pniOpen||{};
const rows=NETS.filter(n=>n.pops.includes(c)).map(n=>{const pn=S.pni.find(x=>x.city===c&&x.net===n.id)||null;const chk=pn?null:peerOk(n.id,'pni',c),v=pn?null:pniVal(n.id,c);return {n,pn,v,chk,s:pniStat(n.id,c).k,go:!!pn||(chk.ok&&v.g>=1)};});
const keep=r=>f==='all'||(f==='t'&&(r.s==='t'||r.s==='none'))||(f==='worth'&&r.v&&r.v.worth)||(f==='pni'&&(r.s==='here'||r.s==='else'));
const val=r=>r.v?r.v.val:-Infinity;
rows.sort((a,b)=>az?a.n.name.localeCompare(b.n.name):(b.v&&b.v.worth)-(a.v&&a.v.worth)||val(b)-val(a)||a.n.name.localeCompare(b.n.name));
let h=`<div class="btns pnif">${[['all',tr('pni_list.f_all')],['t',tr('pni_list.f_transit')],['worth',tr('pni_list.f_worth')],['pni',tr('pni_list.f_pni')]].map(([k,l])=>btn(l,'pniFilter',{f:k},f===k?'sm':'ghost sm')).join('')}${btn(az?tr('pni_list.sort_az'):tr('pni_list.sort_worth'),'pniSort',{},'ghost sm')}</div><p class="note">${tr('pni_list.worth_rule')}</p>`;
const shown=rows.filter(keep);if(!shown.length)return h+`<p class="empty">${tr('pni_list.nothing_matches')}</p>`;
let left=listN('pni'),tot=0;
for(const g of PNI_GRP){const gr=shown.filter(r=>pniGrpOf(r.n)===g);if(!gr.length)continue;
const w=gr.filter(r=>r.v&&r.v.worth).length,act=w||gr.some(r=>r.go),isOpen=f!=='all'||(open[g]??act);
h+=`<div class="pgrp">${btn(`${isOpen?'▾':'▸'} ${esc(pniGrpL(g))} <small>${trn('pni_list.n_networks_w_worth_it',gr.length,{w})}</small>`,'pniGrp',{g,o:isOpen?0:1},'ghost sm')}</div>`;
if(!isOpen)continue;tot+=gr.length;
for(const r of gr){if(left--<=0)break;h+=pniRow(c,r.n,r.pn,r.v,r.chk);}}
return h+listMore('pni',tot,n=>trn('hud_and_panels.n_more_networks',n));}

View file

@ -13,7 +13,7 @@ function pniAllModal(net,tier=1){const b=pniBatch(net,tier);if(!b)return;UI.pniA
${all?`<p class="note">${tr('pni_all.delivery_and_traffic_charges')}</p>`:n.perG?`<p class="note">${tr('pni_all.traffic_charges_apply',{price:fmt$(n.perG)})}</p>`:''}
${S.cash<b.cost?`<p class="why">${tr('interface.not_enough_cash_wait_for_revenue')}</p>`:''}
${all?controls:''}
${all&&b.orders.length?`<details><summary>${trn('pni_all.n_networks',Object.keys(byNet).length)}</summary>${Object.entries(byNet).map(([id,cities])=>`<div class="kv"><b>${esc(NET[id].name)}</b><span>${trn('save.n_pop',cities.length)}</span></div><p class="meta">${cities.map(c=>esc(CITY[c].name)).join(' · ')}</p>`).join('')}</details>`:b.orders.length?`<p class="meta">${b.orders.map(q=>esc(CITY[q.city].name)).join(' · ')}</p><p class="note">${pniEta(net)}</p>`:''}
${all&&b.orders.length?`<details><summary>${trn('pni_all.n_networks',Object.keys(byNet).length)}</summary>${Object.entries(byNet).map(([id,cities])=>`<div class="kv"><b>${esc(NET[id].name)}</b><span>${trn('save.n_pop',cities.length)}</span></div><div class="pchips">${pniChip(id,null)}</div><p class="meta">${cities.map(c=>esc(CITY[c].name)).join(' · ')}</p>`).join('')}</details>`:b.orders.length?`<div class="pchips">${pniChip(net,null)}</div><p class="meta">${b.orders.map(q=>esc(CITY[q.city].name)).join(' · ')}</p><p class="note">${pniEta(net)}</p>`:''}
${b.kept?`<p class="note">${trn('pni_all.n_existing_or_pending_unchanged',b.kept)}</p>`:''}
${b.blocked.length?(all?`<details><summary>${trn('pni_all.n_blocked_connections',b.blocked.length)}</summary>${blocked}</details>`:`<h3>${trn('pni_all.n_blocked_pops',b.blocked.length)}</h3>${blocked}`):''}
${!b.shared.length?`<p class="why">${all?tr('pni_all.no_shared_locations'):tr('pni_all.no_shared_pops')}</p>`:''}

View file

@ -2842,6 +2842,34 @@
"pni_all.pni_size":"PNI size",
"pni_all.setup_total":"Total setup cost",
"pni_all.traffic_charges_apply":"Traffic charges of {price} per Gbps also apply.",
"pni_list.chip_not_reached":"Not reached",
"pni_list.chip_peers_at":"Peers at {list}",
"pni_list.chip_pni_at":"PNI at {list}",
"pni_list.chip_pni_elsewhere":"PNI elsewhere: {list}",
"pni_list.chip_pni_here":"PNI here · {port} · {p}",
"pni_list.chip_pni_here_on_order":"PNI here · on order",
"pni_list.chip_via_a_cone":"Via a peer's cone",
"pni_list.chip_via_cone":"Via {net}'s cone",
"pni_list.chip_via_transit":"Via transit",
"pni_list.f_all":"All",
"pni_list.f_pni":"Already PNI",
"pni_list.f_transit":"Via transit",
"pni_list.f_worth":"Worth it",
"pni_list.list_more":"{list} +{n}",
"pni_list.little_to_gain_here":"Little to gain here: {g}",
"pni_list.n_here":"{g} here",
"pni_list.n_networks_w_worth_it":{"one":"{n} network · {w} worth it","other":"{n} networks · {w} worth it"},
"pni_list.nothing_matches":"No network here matches this filter.",
"pni_list.saves_minus_cost":"Saves {saved} of transit a month; the PNI costs {cost} a month.",
"pni_list.sort_az":"Sort: A–Z",
"pni_list.sort_worth":"Sort: worth it first",
"pni_list.via_drop":"{g} dropped",
"pni_list.via_haul":"{g} hauled",
"pni_list.via_ix":"{g} IX",
"pni_list.via_transit":"{g} transit",
"pni_list.with_port":"{port} PNI: {val}",
"pni_list.worth_it":"Worth it",
"pni_list.worth_rule":"⭐ Worth it: a PNI here saves more transit than it costs each month, carries at least 1 Gbps you drop today, or takes at least 1 Gbps off an exchange port that is 80% full.",
"pnis.a_new_region_is_coming_online":"A new region is coming online soon. It has been coming online soon since 2019.",
"pnis.about_n_days_to_go_nothing":"About {n} days to go. Nothing to do but wait, or chase it.",
"pnis.augment_with_net_delivered_in_city":"<b>Augment with {net} delivered in {city}.</b><br>Now {port}.",

View file

@ -51,6 +51,15 @@ section h3{font-size:17px;margin-bottom:6px;display:flex;align-items:center;gap:
.tag.t1{background:var(--t1)} .tag.t2{background:var(--t2)} .tag.cdn{background:var(--cdn)} .tag.eye{background:var(--eye)}
.tag.open{background:var(--ok)} .tag.selective{background:var(--warn);color:var(--ink)} .tag.restrictive{background:var(--bad)} .tag.paid{background:var(--me)}
.tag.st{background:var(--paper);color:var(--ink)}
/* PNI list (#175): one status chip per network, a one-line value, folded groups. Chips wrap on narrow screens. */
.tag.worth{background:var(--warn);color:var(--ink)}
.pchips{display:flex;flex-wrap:wrap;gap:4px;margin:3px 0}
.pchip{display:inline-block;max-width:100%;border:1.5px solid var(--ink);border-radius:999px;padding:0 7px;font-size:11px;font-weight:800;line-height:1.5;background:var(--paper);color:var(--ink);overflow-wrap:anywhere}
.pchip.pk-here,.pchip.pk-else{background:var(--ok);color:#fff}
.pchip.pk-ix{background:var(--t2);color:#fff}
.pchip.pk-none{background:var(--bad);color:#fff}
.pval{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.pgrp{margin:8px 0 2px}.pgrp .b{width:100%;text-align:left}
.tag.st.on{background:var(--ink);color:#fff}
.bar{height:11px;border:2px solid var(--ink);border-radius:7px;background:var(--paper);overflow:hidden;margin:3px 0}
.stack{display:flex;height:16px;border:2px solid var(--ink);border-radius:8px;overflow:hidden;margin:4px 0 6px;background:var(--paper)}