ONOS-6329 - Added configured property to the Host Panel
Change-Id: I79e8a452fd5f9df955f2d0c2fe2eee65ecb93b1e
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java
index 28f4aa9..4ec61ce 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/topo/Topo2Jsonifier.java
@@ -577,6 +577,7 @@
addIps(node, h);
addProps(node, h);
addGeoGridLocation(node, h);
+ node.put("configured", h.configured());
}
addMetaUi(node, ridStr, host.idAsString());
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2Host.js b/web/gui/src/main/webapp/app/view/topo2/topo2Host.js
index 4247f64..c56b400 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2Host.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2Host.js
@@ -78,6 +78,10 @@
var type = this.get('type');
return remappedDeviceTypes[type] || type || 'm_endstation';
},
+ title: function () {
+ var props = this.get('props');
+ return props.name || this.get('ips')[0] || 'unknown';
+ },
labelIndex: function () {
return t2ps.get('hlbls');
},
diff --git a/web/gui/src/main/webapp/app/view/topo2/topo2HostsPanel.js b/web/gui/src/main/webapp/app/view/topo2/topo2HostsPanel.js
index 4ba1f60..f8273b2 100644
--- a/web/gui/src/main/webapp/app/view/topo2/topo2HostsPanel.js
+++ b/web/gui/src/main/webapp/app/view/topo2/topo2HostsPanel.js
@@ -35,13 +35,20 @@
function formatHostData(data) {
var format = {
- title: data.get('id'),
- propOrder: ['MAC', 'IP', 'VLAN'],
- props: {
+ title: data.title(),
+ propOrder: ['MAC', 'IP', 'VLAN', 'Configured'],
+ propLabels: {
+ 'MAC': 'MAC',
+ 'Configured': 'Configured',
+ 'IP': 'IP',
+ 'VLAN': 'VLAN',
+ },
+ propValues: {
'-': '',
'MAC': data.get('id'),
'IP': data.get('ips')[0],
'VLAN': 'None', // TODO: VLAN is not currently in the data received from backend
+ 'Configured': data.get('configured'),
},
};
@@ -58,6 +65,7 @@
init();
hostData = formatHostData(data);
+ console.log(data);
render();
}
@@ -80,6 +88,7 @@
title.text(hostData.title);
gs.addGlyph(svg, 'bird', 24, 0, [1, 1]);
+ console.log()
ls.listProps(tbody, hostData);
}