Give POPs built by links, fiber, cables and seats the standard routers (#261)
Only Build POP applied the standard. A wave, dark fiber, own subsea cable or consortium seat to a new city now applies it too, and their offers quote newPopCost() (the site plus the standard's routers).
This commit is contained in:
parent
1a4a62d0f2
commit
da1a4e2f3c
8 changed files with 34 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
|||
function openLinkModal(a,b){
|
||||
if([a,b].includes('kyv')&&[a,b].includes('mos')){openModal(`<div style="display:flex;align-items:center"><h2 style="font-size:24px">${tr('common.not_happening')}</h2><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div><p class="lead" style="margin-top:8px">${tr('link_modal.nobody_sells_capacity_between_kyiv')}</p>`);return;}
|
||||
if((cnCity(a)||cnCity(b))&&!cnOk()){openModal(`<div style="display:flex;align-items:center"><h2 style="font-size:24px">${tr('link_modal.not_without_a_license')}</h2><button class="x" data-act="closeModal" aria-label="${tr('common.close')}">×</button></div><p class="lead" style="margin-top:8px">${tr('link_modal.building_into_mainland_china_needs_a',{city:CITY[cnCity(a)?a:b].name})}</p>`);return;}
|
||||
let route='';UI.pending={a,b};const km=kmBetween(a,b),sub=isSub(a,b),pop=S.pops[b]?0:popCost(b),sib=pairLinks(a,b).filter(l=>l.kind!=='vxc');
|
||||
let route='';UI.pending={a,b};const km=kmBetween(a,b),sub=isSub(a,b),pop=S.pops[b]?0:newPopCost(b),sib=pairLinks(a,b).filter(l=>l.kind!=='vxc');
|
||||
if(!sib.length)UI.route='diverse';const border=cnCity(a)!==cnCity(b),jn=sib.length?routeJoin(a,b):null,ts=landTrenches(a,b),mult=(sib.length&&!(jn&&jn.k===(ts[0]||{}).k)?DIVERSE:1)*(border?3*(UI.cnPrem&&(a==='hkg'||b==='hkg')?1.6:1):1);
|
||||
if(border)route+=`<p class="lead" style="margin-top:8px">${tr('link_modal.cross_border_circuits_into_mainland')}</p>${a==='hkg'||b==='hkg'?`<div class="seg">${btn(tr('common.regular_crossing'),'cnPrem',{v:0},!UI.cnPrem?'pink':'ghost')}${btn(tr('link_modal.premium_crossing_60_3_loss'),'cnPrem',{v:1},UI.cnPrem?'pink':'ghost')}</div>`:`<p class="note">${tr('link_modal.premium_crossings_are_only_sold_in')}</p>`}`;
|
||||
if(sib.length&&!(isSub(a,b)&&cablesFor(a,b).length)&&!(UI.via&&UI.via!=='land'&&cablesFor(a,b).some(c=>c.cid===UI.via))){route+=`<p class="lead" style="margin-top:8px">${trn('link_modal.you_already_have_n_link_here',sib.length,{list:sib.map(l=>capName(l)).join(', ')})}</p>
|
||||
|
|
@ -16,6 +16,6 @@ function openLinkModal(a,b){
|
|||
const wr=waveRoute(a,b,mult,border);
|
||||
openModal(`${head}
|
||||
<p class="lead" style="margin-top:8px">${tr('link_modal.waves_are_leased_at_a_flat')}</p>
|
||||
${pop?`<p class="lead" style="margin-top:8px">${tr('link_modal.includes_a_new_pop_in_city',{city:CITY[b].name,price:fmt$(popCost(b)),extra:ruCity(b)?', '+tr('link_modal.government_box_included'):CITY[b].uae?', '+tr('link_modal.free_zone_license_included'):CITY[b].saudi?', '+tr('link_modal.local_telecom_licence_included'):''})}</p>`:''}${route}${viaSeg(a,b)}
|
||||
${pop?`<p class="lead" style="margin-top:8px">${tr('link_modal.includes_a_new_pop_in_city',{city:CITY[b].name,price:fmt$(pop),extra:ruCity(b)?', '+tr('link_modal.government_box_included'):CITY[b].uae?', '+tr('link_modal.free_zone_license_included'):CITY[b].saudi?', '+tr('link_modal.local_telecom_licence_included'):''})}</p>`:''}${route}${viaSeg(a,b)}
|
||||
<div class="tiers">${LT.map((T,i)=>{const lc=Math.round(waveMo(wr.km,wr.sub,i)*wr.wm),c=lc+pop,sw=subWaveWhy(i,wr.km,wr.sub),so=!sw&&soldOut(a,b,i,wr.cab),ok=waveOk(a,b,i)&&!sw&&!so;return !waveShown(i)?'':`<button class="tierbtn" data-act="buildLink" data-args='{"tier":${i}}'${S.cash<c||!ok?' disabled':''}><span class="sz">${T.n}</span><span class="grow meta">${sw?tr('common.too_far_for_this_cable'):so?tr('link_modal.sold_out_for_n_days',{n:Math.max(1,so.until-S.day)}):!ok?tr('link_modal.needs_what_at_both_ends',{what:esc(waveNeed(i))}):pop?tr('link_modal.due_now_price',{price:fmt$(c)}):tr('common.flat_rate')}</span><span class="pr num">${tr('common.price_mo',{price:fmt$(lc)})}</span></button>`;}).join('')}</div>`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue