ONOS-245 Adding more polish and capability to the GUI.
Change-Id: I20cfd48f10de5f053d0c00dc1460d85d5c0d22de
diff --git a/web/gui/src/main/webapp/topo2.js b/web/gui/src/main/webapp/topo2.js
index 2a36dfd..e9a8c1e 100644
--- a/web/gui/src/main/webapp/topo2.js
+++ b/web/gui/src/main/webapp/topo2.js
@@ -141,6 +141,8 @@
U: unpin,
R: resetZoomPan,
H: toggleHover,
+ V: showTrafficAction,
+ A: showAllTrafficAction,
esc: handleEscape
};
@@ -832,8 +834,9 @@
}
// NOTE: hover is only populated if "show traffic on hover" is
- // toggled on, and the item hovered is a host...
- var hoverId = (trafficHover() && hovered && hovered.class === 'host')
+ // toggled on, and the item hovered is a host or a device...
+ var hoverId = (trafficHover() && hovered &&
+ (hovered.class === 'host' || hovered.class === 'device'))
? hovered.id : '';
sendMessage('requestTraffic', {
ids: selectOrder,
@@ -841,6 +844,10 @@
});
}
+ function showAllTrafficAction() {
+ sendMessage('requestAllTraffic', {});
+ }
+
// ==============================
// onos instance panel functions
@@ -1367,14 +1374,14 @@
function nodeMouseOver(d) {
hovered = d;
- if (trafficHover() && d.class === 'host') {
+ if (trafficHover() && (d.class === 'host' || d.class === 'device')) {
showTrafficAction();
}
}
function nodeMouseOut(d) {
hovered = null;
- if (trafficHover() && d.class === 'host') {
+ if (trafficHover() && (d.class === 'host' || d.class === 'device')) {
showTrafficAction();
}
}