GUI -- Implemented cycleDeviceLabels() - themed too.
- cleaned up findDevices(...) .. all devices, or offline devices only. Change-Id: Iac64cdc64393e3c30798975e4aab8ed480deda31
Showing
2 changed files
with
23 additions
and
7 deletions
... | @@ -280,17 +280,30 @@ | ... | @@ -280,17 +280,30 @@ |
280 | stroke: #aaa; | 280 | stroke: #aaa; |
281 | } | 281 | } |
282 | .dark #ov-topo svg .node.device.fixed rect { | 282 | .dark #ov-topo svg .node.device.fixed rect { |
283 | - stroke: #555; | 283 | + stroke: #999; |
284 | } | 284 | } |
285 | 285 | ||
286 | /* note: device is offline without the 'online' class */ | 286 | /* note: device is offline without the 'online' class */ |
287 | -#ov-topo svg .node.device { | 287 | +.light #ov-topo svg .node.device { |
288 | fill: #777; | 288 | fill: #777; |
289 | } | 289 | } |
290 | +.dark #ov-topo svg .node.device { | ||
291 | + fill: #555; | ||
292 | +} | ||
290 | 293 | ||
291 | -#ov-topo svg .node.device.online { | 294 | +.light #ov-topo svg .node.device rect { |
295 | + stroke: #666; | ||
296 | +} | ||
297 | +.light #ov-topo svg .node.device rect { | ||
298 | + stroke: #999; | ||
299 | +} | ||
300 | + | ||
301 | +.light #ov-topo svg .node.device.online { | ||
292 | fill: #6e7fa3; | 302 | fill: #6e7fa3; |
293 | } | 303 | } |
304 | +.dark #ov-topo svg .node.device.online { | ||
305 | + fill: #4E5C7F; | ||
306 | +} | ||
294 | 307 | ||
295 | /* note: device is offline without the 'online' class */ | 308 | /* note: device is offline without the 'online' class */ |
296 | #ov-topo svg .node.device text { | 309 | #ov-topo svg .node.device text { | ... | ... |
... | @@ -440,10 +440,10 @@ | ... | @@ -440,10 +440,10 @@ |
440 | return result; | 440 | return result; |
441 | } | 441 | } |
442 | 442 | ||
443 | - function findOfflineNodes() { | 443 | + function findDevices(offlineOnly) { |
444 | var a = []; | 444 | var a = []; |
445 | network.nodes.forEach(function (d) { | 445 | network.nodes.forEach(function (d) { |
446 | - if (d.class === 'device' && !d.online) { | 446 | + if (d.class === 'device' && !(offlineOnly && d.online)) { |
447 | a.push(d); | 447 | a.push(d); |
448 | } | 448 | } |
449 | }); | 449 | }); |
... | @@ -550,7 +550,7 @@ | ... | @@ -550,7 +550,7 @@ |
550 | updDev(dev, dev.online || showOffline); | 550 | updDev(dev, dev.online || showOffline); |
551 | } else { | 551 | } else { |
552 | // updating all offline devices | 552 | // updating all offline devices |
553 | - findOfflineNodes().forEach(function (d) { | 553 | + findDevices(true).forEach(function (d) { |
554 | updDev(d, showOffline); | 554 | updDev(d, showOffline); |
555 | }); | 555 | }); |
556 | } | 556 | } |
... | @@ -867,7 +867,10 @@ | ... | @@ -867,7 +867,10 @@ |
867 | } | 867 | } |
868 | 868 | ||
869 | function cycleDeviceLabels() { | 869 | function cycleDeviceLabels() { |
870 | - // TODO cycle device labels | 870 | + deviceLabelIndex = (deviceLabelIndex+1) % 3; |
871 | + findDevices().forEach(function (d) { | ||
872 | + updateDeviceLabel(d); | ||
873 | + }); | ||
871 | } | 874 | } |
872 | 875 | ||
873 | // ========================================== | 876 | // ========================================== | ... | ... |
-
Please register or login to post a comment