updates to show link details on click and consolidate link data creation

This commit is contained in:
Blake J. Harnden 2018-05-08 12:02:29 -07:00
parent f588757159
commit 2c353e787c
3 changed files with 88 additions and 9 deletions

View file

@ -2,6 +2,10 @@
height: 100vh;
}
#info-card-table td {
font-size: 12px;
}
.navbar-text {
color: #fff !important;
font-weight: bold;

View file

@ -113,6 +113,16 @@ class CoreNode {
}
}
function setEdgeData(edge, linkId, fromNode, toNode, interfaceOne, interfaceTwo) {
edge.core = linkId;
edge.label = 'from: name\nto: name';
edge.title = 'from: name\nto: name';
edge.nodeOne = fromNode.name;
edge.interfaceOne = interfaceOne;
edge.nodeTwo = toNode.name;
edge.interfaceTwo = interfaceTwo;
}
class CoreNetwork {
constructor(elementId, coreRest) {
this.coreRest = coreRest;
@ -250,13 +260,11 @@ class CoreNetwork {
};
const edge = {
id: linkId,
from: fromNode.id,
to: toNode.id,
recreated: true,
label: 'from: name\nto: name',
title: 'from: name\nto: name'
from: fromNode.id,
to: toNode.id
};
setEdgeData(edge, linkId, fromNode, toNode, interfaceOne, interfaceTwo);
this.edges.add(edge);
}
@ -366,9 +374,7 @@ class CoreNetwork {
interface_two: interfaceTwo
};
edge.id = linkId;
edge.label = 'from: name\nto: name';
edge.title = 'from: name\nto: name';
setEdgeData(edge, linkId, fromNode, toNode, interfaceOne, interfaceTwo);
this.edges.update(edge);
}