ONOS-6327: Implement details panel for host view.
ONOS-6326: Add friendly names to hosts.
- PLENTY more YakShaving:
* some cleanup of the device view handler
* introduce navPath field to PropertyPanel
* introduce "-" name annotation to represent "use default"
* (and more...)
Change-Id: I2afc0f1f29c726b90e97e492527edde2d1345ece
diff --git a/web/gui/src/main/webapp/app/view/topo/topoD3.js b/web/gui/src/main/webapp/app/view/topo/topoD3.js
index e45f491..3d232ee 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoD3.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoD3.js
@@ -139,6 +139,22 @@
ps.setPrefs('topo_prefs', p);
}
+ function incHostLabIndex() {
+ setHostLabIndex(hostLabelIndex+1);
+ switch(hostLabelIndex) {
+ case 0: return 'Show friendly host labels';
+ case 1: return 'Show host IP Addresses';
+ case 2: return 'Show host MAC Addresses';
+ }
+ }
+
+ function setHostLabIndex(mode) {
+ hostLabelIndex = mode % 3;
+ var p = ps.getPrefs('topo_prefs', ttbs.defaultPrefs);
+ p.hlbls = hostLabelIndex;
+ ps.setPrefs('topo_prefs', p);
+ }
+
function hostLabel(d) {
var idx = (hostLabelIndex < d.labels.length) ? hostLabelIndex : 0;
return d.labels[idx];
@@ -617,6 +633,8 @@
incDevLabIndex: incDevLabIndex,
setDevLabIndex: setDevLabIndex,
+ incHostLabIndex: incHostLabIndex,
+ setHostLabIndex: setHostLabIndex,
hostLabel: hostLabel,
deviceLabel: deviceLabel,
trimLabel: trimLabel,