400G cache boxes behind 400G or faster router ports
This commit is contained in:
parent
6b8791c605
commit
7202441716
21 changed files with 55 additions and 29 deletions
|
|
@ -28,8 +28,8 @@ Object.assign(ACT,{
|
|||
else toast(pick([tr('sites_peering_caches.it_is_with_the_provisioning_team'),tr('sites_peering_caches.we_are_waiting_on_the_colo'),tr('sites_peering_caches.your_ticket_was_merged_into_another'),tr('sites_peering_caches.could_you_resend_the_loa_you'),tr('sites_peering_caches.your_account_manager_is_on_paternity')]));after();},
|
||||
peerPol:({p})=>{if(!PPOL.includes(p))return;S.ppol=p;after();},
|
||||
cancelPni:({id,ok})=>{if(!ok&&UI.confirm!==id){UI.confirm=id;renderPanel();return;}S.pni=S.pni.filter(p=>p.id!==id);UI.confirm=null;after();},
|
||||
cache:({city,net})=>{const n=NET[net];if(!n||!n.cache||!S.pops[city])return;if((R.demTo[net]||0)<n.cache.min){toast(tr('sites_peering_caches.net_says_not_yet_send_them',{net:esc(n.name),min:n.cache.min}),'bad');sfx('err');return;}const hv=S.caches.filter(x=>x.city===city&&x.net===net),nb=hv.filter(x=>x.site==='b').length,site=S.pops[city].site2&&nb<hv.length-nb?'b':'a';if(!portGate(city,cachePortsAdd(city,[{site}])))return;
|
||||
S.caches.push({id:uid(),city,net,site});toast(tr('sites_peering_caches.cache_installed_in_city_net_shipped',{cache:esc(n.cache.name),city:CITY[city].name,net:esc(n.name),mo:fmt$(CACHE_MO)}),'good');sfx('build');after();},
|
||||
cache:({city,net})=>{const n=NET[net];if(!n||!n.cache||!S.pops[city])return;if((R.demTo[net]||0)<n.cache.min){toast(tr('sites_peering_caches.net_says_not_yet_send_them',{net:esc(n.name),min:n.cache.min}),'bad');sfx('err');return;}const hv=S.caches.filter(x=>x.city===city&&x.net===net),nb=hv.filter(x=>x.site==='b').length,site=S.pops[city].site2&&nb<hv.length-nb?'b':'a';const box={site,...cacheBox(city)};if(!portGate(city,cachePortsAdd(city,[box])))return;
|
||||
S.caches.push({id:uid(),city,net,...box});toast(tr('sites_peering_caches.cache_installed_in_city_net_shipped',{cache:esc(n.cache.name),city:CITY[city].name,net:esc(n.name),mo:fmt$(cacheMo(box))}),'good');sfx('build');after();},
|
||||
rmCache:({id})=>{S.caches=S.caches.filter(c=>c.id!==id);after();},
|
||||
// Move one of a CDN's boxes to the other building (#69), so a dark building only takes out part of the cache.
|
||||
cacheSite:({city,net,s})=>{if(s!=='a'&&s!=='b'||!S.pops[city]||!S.pops[city].site2)return;const x=S.caches.find(c=>c.city===city&&c.net===net&&(c.site==='b'?'b':'a')!==s);if(!x)return;x.site=s;sfx('click');after();},
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Object.assign(ACT,{
|
|||
utilityCaches:({city,quote,modal})=>{const q=utilityCaches(city);if(!q||!q.add.length)return;
|
||||
if(q.key!==quote){if(modal)utilitiesModal(city,tr('utilities.quote_changed'));else{renderPanel();toast(tr('utilities.quote_changed'));}return;}
|
||||
if(!portGate(city,q.ports))return;
|
||||
for(const c of q.add)S.caches.push({id:uid(),city,net:c.net,site:c.site});
|
||||
for(const c of q.add)S.caches.push({id:uid(),city,net:c.net,site:c.site,...(c.g?{g:c.g}:{})});
|
||||
sfx('build');after();const msg=tr('utilities.caches_requested',{n:q.add.length,city:CITY[city].name});if(modal)utilitiesModal(city,msg);else toast(esc(msg),'good');},
|
||||
utilityPeers:({city}={})=>{if(!S)return;const rows=utilityPeers();let n=0;
|
||||
for(const row of rows)for(const id of row.requests){S.peers[id+'@'+row.ix]=true;n++;}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue