GUI -- Implemented cycleDeviceLabels() - themed too.
- cleaned up findDevices(...) .. all devices, or offline devices only.
Change-Id: Iac64cdc64393e3c30798975e4aab8ed480deda31
diff --git a/web/gui/src/main/webapp/app/view/topo/topo.css b/web/gui/src/main/webapp/app/view/topo/topo.css
index 3ba7767..fa8be31 100644
--- a/web/gui/src/main/webapp/app/view/topo/topo.css
+++ b/web/gui/src/main/webapp/app/view/topo/topo.css
@@ -280,17 +280,30 @@
stroke: #aaa;
}
.dark #ov-topo svg .node.device.fixed rect {
- stroke: #555;
+ stroke: #999;
}
/* note: device is offline without the 'online' class */
-#ov-topo svg .node.device {
+.light #ov-topo svg .node.device {
fill: #777;
}
+.dark #ov-topo svg .node.device {
+ fill: #555;
+}
-#ov-topo svg .node.device.online {
+.light #ov-topo svg .node.device rect {
+ stroke: #666;
+}
+.light #ov-topo svg .node.device rect {
+ stroke: #999;
+}
+
+.light #ov-topo svg .node.device.online {
fill: #6e7fa3;
}
+.dark #ov-topo svg .node.device.online {
+ fill: #4E5C7F;
+}
/* note: device is offline without the 'online' class */
#ov-topo svg .node.device text {
diff --git a/web/gui/src/main/webapp/app/view/topo/topoForce.js b/web/gui/src/main/webapp/app/view/topo/topoForce.js
index b3c8eaa..d7b9a66 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoForce.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoForce.js
@@ -440,10 +440,10 @@
return result;
}
- function findOfflineNodes() {
+ function findDevices(offlineOnly) {
var a = [];
network.nodes.forEach(function (d) {
- if (d.class === 'device' && !d.online) {
+ if (d.class === 'device' && !(offlineOnly && d.online)) {
a.push(d);
}
});
@@ -550,7 +550,7 @@
updDev(dev, dev.online || showOffline);
} else {
// updating all offline devices
- findOfflineNodes().forEach(function (d) {
+ findDevices(true).forEach(function (d) {
updDev(d, showOffline);
});
}
@@ -867,7 +867,10 @@
}
function cycleDeviceLabels() {
- // TODO cycle device labels
+ deviceLabelIndex = (deviceLabelIndex+1) % 3;
+ findDevices().forEach(function (d) {
+ updateDeviceLabel(d);
+ });
}
// ==========================================