Express lightpaths: regen cards for their channels, and dirty connectors dim them (#58)
A regen site added to a fiber that already carries expresses now charges a regen card for every express channel in that glass, as it does for the fiber's own channels. One helper, regenAddCost(), prices it for the action, the fiber panel's button and the MCP dry-run quote, so the three agree. Lighting an express over existing regen sites already paid its cards (xpCost); only adding a site later was free for them. A dirty connector on a fiber is in the glass, so it now dims the expresses riding that fiber by the same factor (capOf multiplies xpG by xpGlassF over the express's fibers), and the express's panel names the fiber. The other link-degrading incidents (MTU mismatch, microbursts, a marginal optic's CRC errors) belong to the fiber's own routers and optics, which an express bypasses, as the optic-failure incident already treats them, so they leave expresses alone. The incident marks the connector with loss.glass=true; sanitize keeps the flag only when it is true, so an old save's loss loads as router-side, as it behaved before. A fiber that only carries expresses can now get the dirty connector too (never the router-side variants), like the backhoe and amp-hut incidents already find it.
This commit is contained in:
parent
2dc8274f34
commit
ae78e82ddb
17 changed files with 123 additions and 9 deletions
|
|
@ -226,7 +226,7 @@ const API_CMD={
|
|||
quote:a=>{const l=S.links.find(x=>x.id===a.id);return l?{setup:sysUpCost(l)}:{};},
|
||||
doc:'Upgrade the line system: Rainbow to ROADMaster to C+L. Every channel goes down for a day.'},
|
||||
regen:{args:[['id','entityId'],['d','step']],watch:['links.#id'],
|
||||
quote:a=>{const l=S.links.find(x=>x.id===a.id);return l&&a.d>0?{setup:REGEN_COST+Math.round((l.ch||[]).reduce((x,c)=>x+optCost(c),0)*REGEN_CH)}:{setup:0};},
|
||||
quote:a=>{const l=S.links.find(x=>x.id===a.id);return l&&a.d>0?{setup:regenAddCost(l)}:{setup:0};},
|
||||
doc:'Add or remove a regeneration site on a terrestrial span, up to REGEN_MAX. Removing is refused if the optics then cannot reach.'},
|
||||
spares:{args:[['id','entityId']],watch:['links.#id'],
|
||||
doc:'Toggle keeping spare optics on site for this span, so a card failure is fixed in hours instead of days.'},
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ const dfCap0=l=>Math.max(0,dfLit(l)-mwG(l));
|
|||
// Whether a fiber carries anything for you (linkDown() asks of every fiber, often): dfCap(l)>0 without adding up every
|
||||
// channel. An optic out of service, or managed waves sold on it, take the sum.
|
||||
const dfOn=l=>{if(l.ready>S.day||l.eqDown>S.day)return false;if(l.chFail&&l.chFail.until>S.day||mwG(l)>0)return dfCap(l)>0;let o=null;for(const c of l.ch||[])if(c!==o){o=c;if(optG(c,l)>0)return true;}return false;};
|
||||
const capOf=l=>(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?dfCap(l):l.kind==='xp'?xpG(l):l.kind==='sat'?l.g:LT[l.tier].g)*(l.deg>S.day?0.5:1)*(l.loss&&l.loss.until>S.day?l.loss.f:1);
|
||||
const capOf=l=>(l.kind==='vxc'?VXC[l.vt].g:l.kind==='df'?dfCap(l):l.kind==='xp'?xpG(l)*xpGlassF(l):l.kind==='sat'?l.g:LT[l.tier].g)*(l.deg>S.day?0.5:1)*(l.loss&&l.loss.until>S.day?l.loss.f:1);
|
||||
// A sick LAG (LACP trouble) keeps only part of its capacity until the incident clears.
|
||||
const lagF=o=>o&&o.lacp&&o.lacp.until>S.day?o.lacp.f:1,ixLagF=x=>lagF(S.ev&&S.ev.ixlacp&&{lacp:S.ev.ixlacp[x]});
|
||||
const tierW=l=>{if(l.kind==='wave')return l.tier;if(l.kind==='vxc'||l.kind==='sat')return 0;const g=l.kind==='xp'?xpG(l):dfCap(l);return g>=6400?4:g>=1600?3:g>=400?2:g>=100?1:0;};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ function sanitize(s){
|
|||
if(!isCity(s.home))s.home=Object.keys(s.pops)[0]||'fra';
|
||||
opsSanitize(s);
|
||||
const tier=v=>int(v,0,PORT.length-1,0),lag=v=>int(v,1,LAG_MAX,1),sid=v=>String(v==null?uid():v).slice(0,40);
|
||||
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.kind==='df'?cmClean(l.list):null;if(L)l.list=L;else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.cname!=null)l.cname=String(l.cname).slice(0,60);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc'&&l.kind!=='xp'&&l.kind!=='sat')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&(!own(CAB,l.cable)||!cablePair(l.cable,l.a,l.b)))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);if(l.day!==undefined)l.day=Math.min(s.day,Math.max(0,num(l.day,s.day)));for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss)l.loss=deg(l.loss);return l;});
|
||||
s.links=s.links.filter(l=>l&&isCity(l.a)&&isCity(l.b)&&l.a!==l.b).map(l=>{l.id=sid(l.id);if(l.list!==undefined){const L=l.kind==='df'?cmClean(l.list):null;if(L)l.list=L;else delete l.list;}l.km=num(l.km,kmBetween(l.a,l.b));l.mo=num(l.mo,0);l.cut=num(l.cut,0);if(l.cname!=null)l.cname=String(l.cname).slice(0,60);if(l.pairs!==undefined)l.pairs=Math.min(l.sub?SUB_PAIRS_MAX:s.lvl>=PAIRS_LV?PAIRS_BIG:PAIRS_MAX,Math.max(1,Math.floor(+l.pairs)||1));if(l.kind!=='df'&&l.kind!=='vxc'&&l.kind!=='xp'&&l.kind!=='sat')l.kind='wave';if(l.kind==='wave')l.tier=int(l.tier,0,LT.length-1,0);if(l.cable&&(!own(CAB,l.cable)||!cablePair(l.cable,l.a,l.b)))l.cable=null;if(l.kind==='vxc'&&!own(VXC,l.vt))l.vt=0;if(l.kind==='df'){if(!own(DF_SYS,l.sys))l.sys='lite';l.ch=Array.isArray(l.ch)?l.ch.filter(o=>own(OPT,o)):[];l.ready=num(l.ready,0);if(l.day!==undefined)l.day=Math.min(s.day,Math.max(0,num(l.day,s.day)));for(const k of Object.keys(SUB_UPGRADES)){const f='sub'+k;if(l[f]!==undefined){if(l.own&&l.sub&&Number.isFinite(l[f])&&l[f]>=0)l[f]=Math.round(l[f]);else delete l[f];}}if(l.seaPath!==undefined){if(l.own&&l.sub&&Array.isArray(l.seaPath)&&l.seaPath.length>=2&&l.seaPath.length<=2048&&l.seaPath.every(p=>Array.isArray(p)&&p.length===2&&p.every(Number.isFinite)&&Math.abs(p[0])<=180&&Math.abs(p[1])<=90))l.seaPath=l.seaPath.map(p=>p.slice());else delete l.seaPath;}if(l.paid!==undefined){if(l.own&&l.sub&&Number.isFinite(l.paid)&&l.paid>=0)l.paid=Math.round(l.paid);else delete l.paid;}if(l.own&&l.sub&&!own(SEA_DESIGNS,l.seaDesign))l.seaDesign='standard';l.regen=int(l.regen,0,REGEN_MAX,0);}const deg=v=>v&&typeof v==='object'?{until:num(v.until,0),f:Math.min(1,Math.max(0,num(v.f,1)))}:null;if(l.loss){const g=l.loss.glass===true;l.loss=deg(l.loss);if(g&&l.loss)l.loss.glass=true;}return l;});
|
||||
for(const l of s.links)repairSubUpgradeDates(l,s.day);
|
||||
xpSanitize(s);
|
||||
/* Metrics moved from each link to its city pair (#122). Older saves routed a pair at the lowest metric of its
|
||||
|
|
|
|||
|
|
@ -32,6 +32,11 @@ function xpRunKm(sp){let cur=0,mx=0;for(const s of sp){const r=s.regen|0,p=s.km/
|
|||
// What optic o carries over that run (0: out of reach), cached like every channel (optG).
|
||||
const xpOptG=(o,run)=>OPT[o]?optG(o,{km:run}):0;
|
||||
function xpG(l){const sp=xpSpans(l);if(!sp)return 0;const run=xpRunKm(sp);let g=0;for(const o of l.ch||[])g+=xpOptG(o,run);return g;}
|
||||
/* What still gets through: a dirty connector in the glass of a fiber under it dims every wave there, this one's too. An
|
||||
MTU mismatch, microbursts or a marginal optic on that fiber belong to its routers and optics, which the express skips. */
|
||||
function xpGlassF(l){const sp=xpSpans(l);if(!sp)return 1;let f=1;for(const s of sp){const x=s.loss;if(x&&x.glass&&x.until>S.day)f*=x.f;}return f;}
|
||||
// The fibers under it with a dirty connector today, for its panel.
|
||||
const xpDim=l=>(xpSpans(l)||[]).filter(s=>s.loss&&s.loss.glass&&s.loss.until>S.day);
|
||||
// The fastest single channel, as a scenario's fast path asks of every hop.
|
||||
function xpHopG(l){const sp=xpSpans(l);if(!sp)return 0;const run=xpRunKm(sp);return Math.max(0,...(l.ch||[]).map(o=>xpOptG(o,run)));}
|
||||
// Dark when a fiber under it is cut, still being built or has its line system down, or nothing lit reaches.
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function* failureRun(only){
|
|||
let tot=opts.reduce((a,o)=>a+o[1],0),r=Math.random()*tot,type=opts[0][0];
|
||||
for(const o of opts){r-=o[1];if(r<=0){type=o[0];break;}}
|
||||
if(only)type=only;
|
||||
if(type==='funny'){const f=['oops','cleaner','harmless','harmless','harmless','ac'];if(live.length)f.push('fatwave','fatwave','mtu','label','loss','loss');if(lagsN().length)f.push('lacp','lacp');if(R.demand>1)f.push('pmtud');if(S.transit.length)f.push('prepend');if(S.day>30)f.push('rpki');if(amps.length)f.push('roadmff');type=pick(f);}
|
||||
if(type==='funny'){const f=['oops','cleaner','harmless','harmless','harmless','ac'];if(live.length)f.push('fatwave','fatwave','mtu','label','loss','loss');else if(bare.length)f.push('loss','loss');if(lagsN().length)f.push('lacp','lacp');if(R.demand>1)f.push('pmtud');if(S.transit.length)f.push('prepend');if(S.day>30)f.push('rpki');if(amps.length)f.push('roadmff');type=pick(f);}
|
||||
const before=R.served;
|
||||
if(type==='harmless'){const m=pick(HARMLESS);S.stats.incidents++;S.stats.survived++;toast(`<b>${m[0]}</b><br>${m[1]}`,'goal');sfx('alert');return;}
|
||||
if(type==='ring'){const cs=Object.keys(S.pops).filter(c=>S.pops[c].site2),c=pick(cs),pp=S.pops[c],dur=2+Math.floor(Math.random()*3);pp.ringcut=S.day+dur;
|
||||
|
|
@ -55,9 +55,11 @@ function* failureRun(only){
|
|||
addInc({type,ref:g.k+':'+g.id,until,msg:tr(msg,{lab}),cost:600,fix:tr('failures.fix_the_lacp_config')},msg);
|
||||
}else if(type==='loss'){
|
||||
const deep=l=>[l.a,l.b].every(c=>S.pops[c]&&/deep-buffer/.test(RG[S.pops[c].rgen||0].chip));
|
||||
const l=pick(live),v=Math.floor(Math.random()*3);
|
||||
// Only the dirty connector (v 0) is in the glass, so it dims the expresses riding the fiber too; microbursts and a
|
||||
// marginal optic are its own routers' and optics'. A fiber that only carries expresses has nothing else to go wrong.
|
||||
const l=pick(live.concat(bare)),r=Math.floor(Math.random()*3),v=xpBare(l)?0:r;
|
||||
if(v===1&&deep(l)){S.stats.incidents++;S.stats.survived++;toast(tr('failures.microbursts_on_a_b_your_deep',{a:CITY[l.a].name,b:CITY[l.b].name}),'goal');return;}
|
||||
const f=[0.6,0.8,0.7][v],dur=2+Math.floor(Math.random()*3);l.loss={until:S.day+dur,f};
|
||||
const f=[0.6,0.8,0.7][v],dur=2+Math.floor(Math.random()*3);l.loss=v?{until:S.day+dur,f}:{until:S.day+dur,f,glass:true};
|
||||
const msg=[N_('failures.a_dirty_connector_on_a_b'),
|
||||
N_('failures.microbursts_on_a_b_overflow_shallow'),
|
||||
N_('failures.crc_errors_on_a_b_a')][v];
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ Object.assign(ACT,{
|
|||
toast(own?tr('fiber_and_hardware.groundbreaking_your_own_fiber_from_a',{a:CITY[a].name,b:CITY[b].name,n:dfBuildDays(km)}):tr('fiber_and_hardware.dark_fiber_iru_signed_a_b',{a:CITY[a].name,b:CITY[b].name}),'goal');after();},
|
||||
regen:({id,d})=>{d=+d;const l=S.links.find(x=>x.id===id);if(!l||l.kind!=='df'||(l.sub&&!l.seat)||(d!==1&&d!==-1))return;const n=(l.regen|0)+d;if(n<0||n>REGEN_MAX)return;
|
||||
if(d<0&&((l.ch||[]).some(o=>!optMode(o,Object.assign({},l,{regen:n})))||xpRegenBad(l,n))){toast(tr('fiber_and_hardware.those_optics_need_the_regen_site'),'bad');sfx('err');return;}
|
||||
if(d>0&&!spend(REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH)))return;l.regen=n;toast(d>0?tr('fiber_and_hardware.regen_site_n_is_up_optical',{n,a:CITY[l.a].name,b:CITY[l.b].name,km:spanKm(l).toLocaleString()}):tr('fiber_and_hardware.regen_site_removed'),'good');sfx('build');after();},
|
||||
if(d>0&&!spend(regenAddCost(l)))return;l.regen=n;toast(d>0?tr('fiber_and_hardware.regen_site_n_is_up_optical',{n,a:CITY[l.a].name,b:CITY[l.b].name,km:spanKm(l).toLocaleString()}):tr('fiber_and_hardware.regen_site_removed'),'good');sfx('build');after();},
|
||||
addCh:({id,o})=>{const l=S.links.find(x=>x.id===id),O=OPT[o];if(!l||!O||l.kind!=='df')return;const why=chWhy(l,o);if(why){toast(tr('fiber_and_hardware.can_t_add_optic_why',{optic:O.n,why:esc(why)}),'bad');sfx('err');return;}if(!portGate(l.a,chPorts(o,l.a))||!portGate(l.b,chPorts(o,l.b)))return;const sp=spareN(o)>0;if(!spend(chCost(l,o)))return;if(sp)S.spares[o]--;(l.ch=l.ch||[]).push(o);floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,`+${O.n}`,'#FF4F9A');after();},
|
||||
rmCh:({id,o})=>{const l=S.links.find(x=>x.id===id);if(!l||!OPT[o]||l.kind==='xp')return;const i=(l.ch||[]).lastIndexOf(o);if(i<0)return;l.ch.splice(i,1);S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;floater((CITY[l.a].x+CITY[l.b].x)/2,(CITY[l.a].y+CITY[l.b].y)/2-20,tr('fiber_and_hardware.optic_to_spares',{optic:OPT[o].n}),'#7B61FF');after();},
|
||||
hwLock:()=>{if(hwLock())return;const c=hwLockCost();if(!spend(c))return;S.hw=S.hw||{};S.hw.lock={until:S.day+HW_LOCK_DAYS,mul:hwTrend(S.day)};toast(tr('fiber_and_hardware.prices_locked_until_date_your_vendor',{date:dateStr(S.hw.lock.until)}),'good');after();},
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ const SPARE_RESALE=0.4,spareN=o=>(S&&S.spares&&S.spares[o])|0,spareValue=o=>Math
|
|||
// A fiber given up (a cancelled IRU, a cable called off, a decommissioned POP) keeps its optics: they go on the shelf too (#229).
|
||||
const chBack=links=>{let n=0;for(const l of links)for(const o of (l&&l.ch)||[])if(OPT[o]){S.spares=S.spares||{};S.spares[o]=(S.spares[o]||0)+1;n++;}return n;};
|
||||
function chCost(l,o){const r=REGEN_CH*(l.regen|0);return Math.round(optCost(o)*(spareN(o)>0?r:1+r));}
|
||||
// One more regen site on fiber l: the hut, and a regen card for every channel in its glass, the expresses riding it too.
|
||||
function regenAddCost(l){let o=(l.ch||[]).reduce((a,c)=>a+optCost(c),0);for(const x of xpOver(l.id))for(const c of x.ch||[])o+=optCost(c);return REGEN_COST+Math.round(o*REGEN_CH);}
|
||||
function optCost(o){return Math.round(OPT[o].cost*techMul(OPT[o].lvl)*hwMul('opt')*(S&&S.ev&&S.ev.tariff>S.day?1.4:1));}
|
||||
// Line systems upgrade in place: Rainbow → ROADMaster → C+L. Every lit pair gets the new gear.
|
||||
const sysNext=l=>l.sys==='lite'?'roadm':l.sys==='roadm'?'cl':null,sysUpCost=l=>{const t=sysNext(l);return t?sysCost(t)*(t==='cl'&&l.own?Math.max(1,l.pairs|0):1):0;};
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ function dfPanel(l){
|
|||
h+=`<div class="row"><div class="grow"><div class="nm">${O.n} <span class="meta">${optModes(k,l).map(([g,r])=>tr('link_panels.g_to_km_km',{g:fmtG(g),km:r.toLocaleString()})).join(' · ')}</span></div><div class="meta">${esc(O.blurb)}${n?` · <b>${tr('link_panels.n_lit',{n})}</b>`:''}${sp?` · ${trn('link_panels.n_spare_on_the_shelf',sp)}`:''}${(np=>np>1?` · ${trn('link_panels.takes_n_router_ports_per_end',np)}`:'')(Math.max(chPorts(k,l.a),chPorts(k,l.b)))}</div>${md&&!md.full?`<div class="meta">⚠️ ${tr('link_panels.runs_at_g_per_channel_on',{g:fmtG(md.g)})} ${(!l.sub||l.seat)&®enNeed(k,l)>(l.regen|0)?trn('link_panels.n_regen_site_would_bring_it',regenNeed(k,l),{g:fmtG(O.g)}):''}</div>`:''}${why?`<div class="why">${esc(why)}</div>`:''}${!techOk('opt',k,O.lvl)&&demoCan(O.lvl)?`<div class="btns">${demoBtn('opt',k,O.lvl,'','ghost sm')}</div>`:''}${opticCountControl(l,k,n)}</div>${n?btn('−','rmCh',{id:l.id,o:k},'ghost sm'):''}${btn(sp?`+ <small>${cc?tr('link_panels.spare_price',{price:fmt$(cc)}):tr('common.spare')}</small>`:`+ <small>${fmt$(cc)}</small>`,'addCh',{id:l.id,o:k},'sm',!!why||S.cash<cc)}</div>`;}
|
||||
{const st=Object.keys(OPT).filter(k=>spareN(k)>0);h+=`<p class="note">${tr('link_panels.unplugged_optics_go_on_the_spares')}</p>`;
|
||||
{const used=[...new Set(l.ch||[])].filter(k=>OPT[k]&&OPT[k].lvl<=glassLvl());if(used.length)h+=`<div class="btns">${used.map(k=>btn(tr('link_panels.stock_a_spare_optic_price',{optic:OPT[k].n,price:fmt$(optCost(k))}),'buySpare',{o:k},'ghost sm',S.cash<optCost(k)||spareN(k)>=64)).join('')}</div><p class="meta">${tr('link_panels.spares_bought_now_are_already_paid')}</p>`;}if(st.length)h+=`<h4 class="sub4">${tr('common.spares_shelf')}</h4>`+st.map(k=>`<div class="row"><div class="grow"><div class="nm">${spareN(k)} × ${OPT[k].n}</div></div>${btn(tr('link_panels.sell_one_price',{price:fmt$(spareValue(k))}),'sellSpare',{o:k},'ghost sm')}</div>`).join('');}
|
||||
const rg=l.regen|0,rgAdd=REGEN_COST+Math.round((l.ch||[]).reduce((a,c)=>a+optCost(c),0)*REGEN_CH);
|
||||
const rg=l.regen|0,rgAdd=regenAddCost(l);
|
||||
h+=`</section><section><h3>${tr('common.line_system')}</h3><div class="kv"><span>${esc(sysD.n)}</span><b>${tr('link_panels.n_amplifiers',{n:amps})}</b></div>
|
||||
<div class="kv"><span>${tr('common.regen_sites')}</span><b>${rg?tr('link_panels.n_optical_spans_of_km_km',{n:rg,km:spanKm(l).toLocaleString()}):tr('common.none')}</b></div><p class="note">${tr('link_panels.a_regen_site_turns_the_light',{price:fmt$(REGEN_MO)})}</p>${l.seat?`<p class="note">${tr('broker.seat_regen_note')}</p>`:''}${l.sub&&l.own&&!l.seat?`<p class="note">${tr('link_panels.no_regen_sites_in_the_middle')}</p>`:`<div class="btns">${rg<REGEN_MAX?btn(tr('link_panels.regen_site_price',{price:fmt$(rgAdd)}),'regen',{id:l.id,d:1},'sm',S.cash<rgAdd):''}${rg?btn(tr('common.regen_site'),'regen',{id:l.id,d:-1},'ghost sm'):''}</div>`}<p class="note">${esc(sysD.blurb)}</p><div class="btns">${(()=>{const t=sysNext(l);if(!t)return '';const T=DF_SYS[t],c=sysUpCost(l);return !techOk('sys',t,T.lvl)?demoBtn('sys',t,T.lvl,tr('link_panels.sys_level_n',{sys:T.n,n:T.lvl}),'sm'):btn(tr('link_panels.upgrade_to_sys_price',{sys:T.n,price:fmt$(c)}),'upSys',{id:l.id},'sm',S.cash<c);})()}${pairBtn(l)}${btn(l.spares?tr('link_panels.spares_kit_on'):tr('link_panels.keep_a_spares_kit_price_mo',{price:fmt$(Math.round(150+(l.ch||[]).length*80))}),'spares',{id:l.id},l.spares?'green sm':'sm')}</div><p class="note">${tr('link_panels.spare_optics_and_amplifier_cards_on')}</p></section>`;
|
||||
h+=xpDfSection(l);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ function xpPanel(l){const sp=xpSpans(l),load=R.load[l.id]||0,cap=capOf(l),u=cap?
|
|||
let h=`<div class="ph"><div><div class="eyebrow">${tr('express.eyebrow',{km:Math.round(l.km).toLocaleString()})}</div><h2>${A} ⇄ ${B}</h2></div><button class="x" data-act="closePanel" aria-label="${tr('common.close')}">×</button></div><div class="scroll">`;
|
||||
if(down)h+=`<section><h3 style="color:var(--tx-red,var(--bad))">${tr('common.dark_6bf5')}</h3>${xpDarkWhy(l).map(t=>`<p class="lead">${t}</p>`).join('')}</section>`;
|
||||
h+=`<section><h3>${tr('common.capacity')}</h3><div class="kv"><span>${trn('express.n_channels',ch.length)}</span><b>${fmtG(load)} / ${fmtG(cap)}</b></div><div class="bar ${barCls(u)}"><i style="width:${Math.min(100,u*100)}%"></i></div>
|
||||
<div class="kv"><span>${tr('common.latency')}</span><b>${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}</b></div><div class="kv"><span>${tr('express.optical_run')}</span><b>${run.toLocaleString()} km</b></div>
|
||||
${down?'':xpDim(l).map(s=>`<p class="why">${tr('express.dim',{span:xpSpanName(s),p:pct(s.loss.f)})}</p>`).join('')}<div class="kv"><span>${tr('common.latency')}</span><b>${tr('common.ms_ms_one_way',{ms:linkLat(l).toFixed(1)})}</b></div><div class="kv"><span>${tr('express.optical_run')}</span><b>${run.toLocaleString()} km</b></div>
|
||||
<p class="note">${tr('express.passes',{via:esc(xpVia(l))})}</p></section>`;
|
||||
if(sp)h+=`<section><h3>${tr('express.its_fibers')}</h3>${sp.map(s=>`<div class="row"><div class="grow"><div class="nm">${xpSpanName(s)} ${linkCut(s)?'<span class="tag restrictive">'+tr('common.cut')+'</span>':''}</div><div class="meta">${xpSpanMeta(s)}</div></div>${btn(tr('common.open'),'selLink',{id:s.id},'ghost sm')}</div>`).join('')}<p class="note">${tr('express.slot_note')}</p></section>`;
|
||||
if(sp){h+=`<section><h3>${tr('common.optics')}</h3>`;
|
||||
|
|
|
|||
|
|
@ -2067,6 +2067,7 @@
|
|||
"express.dark_gone":"One of the fibers under it is gone.",
|
||||
"express.dark_reach":"None of its optics reach over this run.",
|
||||
"express.dark_system":"{span} has its line system down.",
|
||||
"express.dim":"{span} has a dirty connector: every wave in that fiber, this express too, runs at {p} until someone cleans it.",
|
||||
"express.express_to":"Express to…",
|
||||
"express.eyebrow":"Express lightpath · {km} km",
|
||||
"express.fiber_busy":{"one":"<b>An express lightpath rides this fiber.</b><br>Tear it down first: open it from this fiber's Express section.","other":"<b>{n} express lightpaths ride this fiber.</b><br>Tear them down first: open them from this fiber's Express section."},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue