cambios camacho v1
[VSoRC/.git] / js / topology / topology.js
index 0f6e1f1ba426019396ffcf5359281ef406f0cd9a..45040e107c1709d4bfd6353d5f94950520fc3a07 100644 (file)
@@ -74,8 +74,9 @@ $(function () {
         }
 
         lst = top.hosts;
+        console.log(top.hosts);
         for (var i = 0; i < lst.length; i++) {
-            nodes.push({ "id": lst[i].mac, "type": "host" });
+            nodes.push({ "id": lst[i].mac, "type": "host","ip": lst[i].ipv4});
             links.push({
                 "source": lst[i].port.dpid, "target": lst[i].mac, "value": 2,
                 "port": { "source": lst[i].port.port_no, "target": 0 }
@@ -153,6 +154,12 @@ $(function () {
             .attr("class", "label")
             .attr("dy", size + 14)
             .text(function (d) { return d.id; });
+
+
+       node.append("text")
+            .attr("class", "label")
+            .attr("dy", size + 26)
+            .text(function (d) { if (d.type === "host")return (d.ip); });
             // .text(function (d) { return d.id.replace(/^0+/, ''); });