[ONOS-6657] Topo2: Added Host label cycling:
Hide Label
Show Friendly Label
Show Ip Address
Show MAC Address
Change-Id: I0e5b9f303960f71b6cd45b97a2e748ff64a1fae9
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2KeyCommands.js b/web/gui/src/main/webapp/app/view/topo2/topo2KeyCommands.js
index a3b75f5..b396f30 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2KeyCommands.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2KeyCommands.js
@@ -35,6 +35,7 @@
H: [toggleHosts, 'Toggle host visibility'],
M: [toggleOfflineDevices, 'Toggle offline visibility'],
dot: [toggleToolbar, 'Toggle Toolbar'],
+ 'shift-L': [cycleHostLabels, 'Cycle host labels'],
esc: handleEscape,
@@ -114,6 +115,15 @@
}
}
+ function hostLabelFlashMessage(index) {
+ switch (index) {
+ case 0: return 'Hide host labels';
+ case 1: return 'Show friendly host labels';
+ case 2: return 'Show host IP labels';
+ case 3: return 'Show host MAC Address labels';
+ }
+ }
+
function cycleDeviceLabels() {
var deviceLabelIndex = t2ps.get('dlbls') + 1,
newDeviceLabelIndex = deviceLabelIndex % 3;
@@ -123,6 +133,15 @@
flash.flash(deviceLabelFlashMessage(newDeviceLabelIndex));
}
+ function cycleHostLabels() {
+ var hostLabelIndex = t2ps.get('hlbls') + 1,
+ newHostLabelIndex = hostLabelIndex % 4;
+
+ t2ps.set('hlbls', newHostLabelIndex);
+ t2fs.updateNodes();
+ flash.flash(hostLabelFlashMessage(newHostLabelIndex));
+ }
+
function toggleBackground(x) {
t2bgs.toggle(x);
}