Thomas Vachuska

Fixed labels issue.

Change-Id: I9d213392c5ca337b1732ad23bfcb40d196a2acb8
......@@ -302,6 +302,7 @@ public abstract class TopologyViewMessages {
// Generate labels: id, chassis id, no-label, optional-name
String name = device.annotations().value("name");
ArrayNode labels = mapper.createArrayNode();
labels.add("");
labels.add(isNullOrEmpty(name) ? device.id().toString() : name);
labels.add(device.id().toString());
......
......@@ -95,7 +95,7 @@
"a5 5 0 0 1 5 5 v65 a5 5 0 0 1 -5 5 z M-41 -32.5 l11 -11 " +
"a10 3 0 0 1 10 -2 h40 a10 3 0 0 1 10 2 l11 11 z M-39 -20 " +
"a5 5 0 0 1 10 0 a5 5 0 0 1 -10 0 z ",
host: "M-45 -40 a5 5 0 0 1 5 -5 h65 a5 5 0 0 1 5 5 v80 " +
endstation: "M-45 -40 a5 5 0 0 1 5 -5 h65 a5 5 0 0 1 5 5 v80 " +
"a5 5 0 0 1 -5 5 h-65 a5 5 0 0 1 -5 -5 z M32.5 -41 l11 11 " +
"a3 10 0 0 1 2 10 v40 a3 10 0 0 1 -2 10 l-11 11 z M-38 -36 " +
"a2 2 0 0 1 2 -2 h56 a2 2 0 0 1 2 2 v26 a2 2 0 0 1 -2 2 h-56 " +
......
......@@ -175,7 +175,7 @@
},
webSock,
sid = 0,
deviceLabelCount = 2,
deviceLabelCount = 3,
hostLabelCount = 2,
deviceLabelIndex = 0,
hostLabelIndex = 0,
......@@ -314,7 +314,7 @@
}
function cycleLabels() {
deviceLabelIndex = (deviceLabelIndex === network.deviceLabelCount - 1)
deviceLabelIndex = (deviceLabelIndex === 2)
? 0 : deviceLabelIndex + 1;
network.nodes.forEach(function (d) {
......@@ -1237,8 +1237,6 @@
svgCls = type ? 'node device ' + type : 'node device',
labels = device.labels || [];
labels.unshift(''); // add 'no-label' to front of cycle
// Augment as needed...
node.class = 'device';
node.svgClass = device.online ? svgCls + ' online' : svgCls;
......@@ -1517,12 +1515,12 @@
hostRadius = {
bgpSpeaker: 14,
router: 14,
host: 14
endstation: 14
},
hostGlyphId = {
bgpSpeaker: 'bgpSpeaker',
router: 'router',
host: 'host'
endstation: 'endstation'
};
......