From a29007de0e04a6d23f6ab1d36e3859f313a85437 Mon Sep 17 00:00:00 2001
From: Wes Felter <wmf@us.ibm.com>
Date: Wed, 13 Jun 2012 19:16:40 -0500
Subject: [PATCH] UI: Update topology graph due to REST API changes.

---
 src/main/resources/web/js/views/topology.js | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/main/resources/web/js/views/topology.js b/src/main/resources/web/js/views/topology.js
index 630c06de3..a5988b4fc 100644
--- a/src/main/resources/web/js/views/topology.js
+++ b/src/main/resources/web/js/views/topology.js
@@ -43,14 +43,13 @@ window.TopologyView = Backbone.View.extend({
 
           for (var i = 0; i < this.hosts.length; i++) {
             host = this.hosts[i];
-            if (( host.attributes['network-addresses'].length > 0 ) && 
-                    ('ip' in host.attributes['network-addresses'][0])) {
-                host.name = host.attributes['network-addresses'][0]['ip'] + "\n" + host.id;
+            if (host.attributes['ipv4'].length > 0) {
+                host.name = host.attributes['ipv4'][0] + "\n" + host.id;
             } else {
                 host.name = host.id;
             }
             host.group = 2;
-            console.log(host);
+            //console.log(host);
           }
 
           var all_nodes = this.model.nodes.concat(this.hosts);
@@ -63,11 +62,11 @@ window.TopologyView = Backbone.View.extend({
 
           for (var i = 0; i < this.hosts.length; i++) {
             host = this.hosts[i];
-            for (var j = 0; j < host.attributes['attachment-points'].length; j++) {
+            for (var j = 0; j < host.attributes['attachmentPoint'].length; j++) {
               var link = {source:all_nodes_map[host.id],
-                      target:all_nodes_map[host.attributes['attachment-points'][j]['switch']],
+                      target:all_nodes_map[host.attributes['attachmentPoint'][j]['switchDPID']],
                       value:10};
-              console.log(link);
+              //console.log(link);
               if ( link.source && link.target) {
                   this.host_links.push(link);
               } else {
-- 
GitLab