Add leased-line savings and connection management to the NOC dashboard
A new "Leased lines" tab groups every leased wave, fabric circuit and dark fiber IRU between your POPs by route and prices it against leasing dark fiber, digging your own fiber or laying your own subsea cable, including the line system, amplifiers, regen sites and optics for today's capacity. It shows the savings and payback, explains why a route can't be replaced, and plans the build in one tap. The Connections tab can now upgrade, grow and cancel every connection: the next port size and another LAG member for transit, PNIs and IX ports, another cache box, a bigger fabric port, and a cancel button with the same confirm step as the POP panel. Your own exchange has none. The dashboard refreshes after any action while it is open.
This commit is contained in:
parent
ef3dc0e8f8
commit
8238606483
4 changed files with 187 additions and 7 deletions
|
|
@ -670,3 +670,102 @@ test('deal navigation visits the first missing POP, including second endpoints a
|
|||
ev("S.offers[0].type='l2vpn';delete S.offers[0].sites;S.offers[0].city='bde';renderLeft()");assert.equal(JSON.parse(go().dataset.args).city,'bde','single-site offers still work');
|
||||
assert.deepEqual(errors,[]);
|
||||
});
|
||||
|
||||
test('NOC leased lines tab prices leased dark fiber, own fiber and cables against the leases', () => {
|
||||
const { ev, errors } = load();
|
||||
base(ev);
|
||||
ev("S.cash=1e9;S.lvl=3;for(const c of ['ams','lon','nyc','par'])ACT.buildPop({city:c});for(const c in S.pops)S.pops[c].rgen=2;const L=(a,b,t)=>{UI.via=null;openLinkModal(a,b);ACT.buildLink({tier:t});closeModal();};L('fra','ams',2);L('fra','ams',2);L('lon','nyc',1);L('fra','par',1);compute()");
|
||||
ev("ACT.dash();ACT.dashTab({k:'lease'})");
|
||||
let t = ev("document.getElementById('dashCard').textContent");
|
||||
assert.match(t, /Leased lines/);
|
||||
assert.match(t, /Amsterdam ⇄ Frankfurt/);
|
||||
assert.match(t, /Lease dark fiber: .* up front/);
|
||||
assert.match(t, /Your own fiber: .* up front/);
|
||||
assert.match(t, /Go transit-free first/, 'own subsea cables stay Tier 1 only');
|
||||
const land = JSON.parse(ev("JSON.stringify(leaseSwaps().find(x=>x.a==='ams'))"));
|
||||
assert.equal(land.ls.length, 2, 'parallel waves on one route are grouped');
|
||||
assert.equal(land.cap, 800);
|
||||
const iru = land.opts.find(o => o.k === 'iru'), own = land.opts.find(o => o.k === 'own');
|
||||
assert.equal(iru.days, 30);
|
||||
assert.equal(iru.save, land.mo - iru.omo);
|
||||
assert.ok(iru.save > 0 && iru.pay > 0, 'two 400G waves are worth moving onto dark fiber');
|
||||
assert.ok(iru.up < own.up, 'leased glass costs less up front than digging');
|
||||
assert.ok(own.up > ev("dfBuildCost(kmBetween('ams','fra'))"), 'optics and line system are in the estimate');
|
||||
assert.equal(land.best, Math.max(iru.save, own.save));
|
||||
ev("S.won=true");
|
||||
assert.match(ev("leaseSwaps().find(x=>x.sub).why"), /No optic you can buy reaches/, "Tier 1 alone is not enough without long-haul optics");
|
||||
ev("S.lvl=4;renderDash()");
|
||||
const sub = JSON.parse(ev("JSON.stringify(leaseSwaps().find(x=>x.sub))"));
|
||||
assert.equal(sub.why, '');
|
||||
assert.ok(sub.opts.find(o => o.k === 'cab').up > ev("ownCabCost(ownCabKm('lon','nyc'))"));
|
||||
ev("for(const c of ['mrs','sin'])ACT.buildPop({city:c});for(const c in S.pops)S.pops[c].rgen=2;UI.via=null;openLinkModal('mrs','sin');ACT.buildLink({tier:2});closeModal();compute()");
|
||||
const ms = JSON.parse(ev("JSON.stringify(leaseSwaps().find(x=>x.a==='mrs'&&x.b==='sin'))"));
|
||||
assert.ok(ms && ms.opts.some(o => o.k === 'cab'), 'landing stations on one landmass can swap a wave for your own cable (#67)');
|
||||
ev("ACT.leaseSwap({a:'ams',b:'fra',src:'lease'})");
|
||||
assert.equal(ev("document.getElementById('dash').hidden"), true);
|
||||
assert.match(ev("document.getElementById('modal').textContent"), /Sign the IRU/);
|
||||
ev("closeModal();ACT.leaseSwap({a:'ams',b:'fra',src:'build'})");
|
||||
assert.match(ev("document.getElementById('modal').textContent"), /Start construction/);
|
||||
ev("closeModal();S.links.push({id:'iru1',a:'fra',b:'par',kind:'df',km:480,sys:'roadm',ch:[],ready:0,mo:900,day:0,cut:0});S.links.push({id:'own1',a:'fra',b:'ams',kind:'df',own:true,km:400,sys:'roadm',ch:[],ready:0,mo:60,day:0,cut:0});ACT.dash();ACT.dashTab({k:'lease'})");
|
||||
t = ev("document.getElementById('dashCard').textContent");
|
||||
assert.match(t, /You already own fiber here/);
|
||||
assert.match(t, /You already lease dark fiber here/);
|
||||
const par = JSON.parse(ev("JSON.stringify(leaseSwaps().find(x=>x.b==='par'))"));
|
||||
assert.ok(!par.opts.some(o => o.k === 'iru'), 'no second IRU offered next to the one you lease');
|
||||
assert.ok(!ev("leaseSwaps().some(x=>x.ls.some(l=>l.own))"), 'your own fiber is never listed as a lease');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('connections in the NOC dashboard can be cancelled right there, after a confirm', () => {
|
||||
const { ev, errors } = load();
|
||||
base(ev);
|
||||
ev("ACT.buildPop({city:'ams'});ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyIx({city:'ams',tier:1});S.pni.push({id:'pn1',city:'fra',net:'nfx',tier:1});S.caches.push({id:'cc1',city:'fra',net:'ggl'},{id:'cc2',city:'fra',net:'ggl'});S.nni.push({city:'fra',prov:'mgp',tier:0});compute();ACT.connOpen()");
|
||||
const card = () => ev("document.getElementById('dashCard').textContent");
|
||||
const click = (k, id) => ev(`ACT.connCancel(${JSON.stringify({ k, id })})`);
|
||||
assert.equal(ev("conns().length"), 5);
|
||||
const tid = ev("S.transit[0].id");
|
||||
click('t', tid);
|
||||
assert.match(card(), /Really cancel\?/, 'first tap only asks');
|
||||
assert.equal(ev("S.transit.length"), 1);
|
||||
click('t', tid);
|
||||
assert.equal(ev("S.transit.length"), 0);
|
||||
assert.doesNotMatch(card(), /Really cancel\?/, 'the list refreshes in place');
|
||||
click('p', 'pn1'); click('p', 'pn1');
|
||||
assert.equal(ev("S.pni.length"), 0);
|
||||
click('ix', 'ams');
|
||||
assert.match(card(), /Really leave\?/);
|
||||
click('ix', 'ams');
|
||||
assert.equal(ev("S.ixp.ams"), undefined);
|
||||
click('c', 'cc1'); click('c', 'cc1');
|
||||
assert.equal(ev("S.caches.length"), 1, 'caches go one box at a time');
|
||||
click('nni', 'fra|mgp'); click('nni', 'fra|mgp');
|
||||
assert.equal(ev("S.nni.length"), 0);
|
||||
ev("S.myIx.fra={name:'Test-IX',members:[],next:S.day+4};S.ixp.fra=2;compute();renderDash()");
|
||||
click('ix', 'fra'); click('ix', 'fra');
|
||||
assert.equal(ev("S.ixp.fra"), 2, 'your own exchange cannot be cancelled from the list');
|
||||
assert.equal(ev("document.getElementById('dash').hidden"), false);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
||||
test('connections in the NOC dashboard can be upgraded and grown into LAGs right there', () => {
|
||||
const { ev, errors } = load();
|
||||
base(ev);
|
||||
ev("ACT.buildPop({city:'ams'});for(const c in S.pops)S.pops[c].rgen=2;ACT.buyTransit({city:'fra',net:'cog',tier:1});ACT.buyIx({city:'ams',tier:1});S.pni.push({id:'pn1',city:'fra',net:'nfx',tier:1});S.nni.push({city:'fra',prov:'mgp',tier:0});compute();ACT.connOpen()");
|
||||
const tap = act => ev(`(()=>{const b=document.querySelector('#dashCard [data-act="${act}"]');if(!b||b.disabled)return false;b.click();return true;})()`);
|
||||
assert.ok(tap('lagT'), 'transit row offers a LAG member');
|
||||
assert.equal(ev("S.transit[0].n"), 2);
|
||||
assert.match(ev("document.getElementById('dashCard').textContent"), /Upgrade all to 400G/, 'the list refreshes with the LAG');
|
||||
assert.ok(tap('buyTransit'));
|
||||
assert.equal(ev("S.transit[0].tier"), 2);
|
||||
assert.ok(tap('lagP'));
|
||||
assert.equal(ev("S.pni[0].n"), 2);
|
||||
assert.ok(tap('lagIx'));
|
||||
assert.equal(ev("S.ixn.ams"), 2);
|
||||
assert.ok(tap('buyIx'));
|
||||
assert.equal(ev("S.ixp.ams"), 2);
|
||||
assert.ok(tap('buyNni'));
|
||||
assert.equal(ev("S.nni[0].tier"), 1);
|
||||
assert.equal(ev("document.querySelector('#dashCard [data-act=\"buyNni\"]')"), null, 'no upgrade past the biggest fabric port');
|
||||
assert.equal(ev("document.getElementById('dash').hidden"), false);
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue