GUI- poke the traffic monitor to resend highlight data, on topology event.
- also, fix potential NPE (.el element may be null)
Change-Id: Ibdb5085404e81bfa770ee80d1457bc630635a169
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
index f9063ad..f25ef91 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/TopologyViewMessageHandler.java
@@ -741,6 +741,7 @@
public void event(DeviceEvent event) {
if (event.type() != PORT_STATS_UPDATED) {
msgSender.execute(() -> sendMessage(deviceMessage(event)));
+ msgSender.execute(traffic::pokeIntent);
eventAccummulator.add(event);
}
}
@@ -751,6 +752,7 @@
@Override
public void event(LinkEvent event) {
msgSender.execute(() -> sendMessage(linkMessage(event)));
+ msgSender.execute(traffic::pokeIntent);
eventAccummulator.add(event);
}
}
@@ -760,6 +762,7 @@
@Override
public void event(HostEvent event) {
msgSender.execute(() -> sendMessage(hostMessage(event)));
+ msgSender.execute(traffic::pokeIntent);
eventAccummulator.add(event);
}
}
diff --git a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
index 63fc2c8..fb15e94 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js
@@ -333,7 +333,7 @@
var hdata = api.findNodeById(host.id),
badgeData = host.badge || null;
- if (hdata && !hdata.el.empty()) {
+ if (hdata && hdata.el && !hdata.el.empty()) {
hdata.badge = badgeData;
if (!host.subdue) {
api.unsupNode(hdata.id, less);
@@ -346,7 +346,7 @@
var ddata = api.findNodeById(device.id),
badgeData = device.badge || null;
- if (ddata && !ddata.el.empty()) {
+ if (ddata && ddata.el && !ddata.el.empty()) {
ddata.badge = badgeData;
if (!device.subdue) {
api.unsupNode(ddata.id, less);
@@ -359,7 +359,8 @@
var ldata = api.findLinkById(link.id),
lab = link.label,
units, portcls, magnitude;
- if (ldata && !ldata.el.empty()) {
+
+ if (ldata && ldata.el && !ldata.el.empty()) {
if (!link.subdue) {
api.unsupLink(ldata.key, less);
}