Cache boxes share router ports: as many 100G boxes per port as its speed holds (closes #252)

This commit is contained in:
Frederic Jung 2026-11-01 11:03:37 +01:00
parent 38fdf9b4d8
commit 999aaca0e8
No known key found for this signature in database
8 changed files with 62 additions and 11 deletions

View file

@ -13,8 +13,8 @@ function utilityKitLine(city){const q=utilityKit(city);if(!q)return '';const tod
function utilityCachesHtml(city,modal=false){const q=utilityCaches(city);if(!q)return '';
return `<section><h3>${tr('common.embedded_caches')}</h3><p class="lead">${tr('utilities.cache_note')}</p>
<p class="meta">${tr('utilities.cache_quote',{n:q.add.length,mo:fmt$(q.mo)})}</p>
${q.free<q.add.length?`<p class="why">${tr('utilities.cache_ports',{need:q.add.length,free:fmtPorts(q.free)})}</p>`:''}
<div class="btns">${btn(tr('utilities.request_caches',{n:q.add.length}),'utilityCaches',{city,quote:q.key,modal},'pink',!q.add.length||q.free+1e-9<q.add.length)}</div></section>`;}
${q.free+1e-9<q.ports?`<p class="why">${tr('utilities.cache_ports',{need:q.ports,free:fmtPorts(q.free)})}</p>`:''}
<div class="btns">${btn(tr('utilities.request_caches',{n:q.add.length}),'utilityCaches',{city,quote:q.key,modal},'pink',!q.add.length||q.free+1e-9<q.ports)}</div></section>`;}
function utilitiesModal(city,message){if(!S)return;const cities=Object.keys(S.pops).sort((a,b)=>CITY[a].name.localeCompare(CITY[b].name));
city=S.pops[city]?city:UI.sel&&UI.sel.type==='city'&&S.pops[UI.sel.id]?UI.sel.id:S.pops[S.home]?S.home:cities[0];
const rows=utilityPeers(),n=rows.reduce((v,r)=>v+r.requests.length,0),rs=utilityRouteServers().length;