Fix NPE and enhance flows table 17/317/1
authorAndrew Kim <andrekim@cisco.com>
Wed, 8 May 2013 01:37:45 +0000 (18:37 -0700)
committerAndrew Kim <andrekim@cisco.com>
Wed, 8 May 2013 01:37:45 +0000 (18:37 -0700)
NPE in devices web caused loop in JS
Added ingress port to flows table

Signed-off-by: Andrew Kim <andrekim@cisco.com>
opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java
opendaylight/web/flows/src/main/resources/js/page.js

index 1102a63..ec59ab7 100644 (file)
@@ -207,6 +207,9 @@ public class Devices implements IDaylightWeb {
         IForwardingStaticRouting staticRouting = (IForwardingStaticRouting) ServiceHelper
                 .getInstance(IForwardingStaticRouting.class, containerName,
                         this);
+        if (staticRouting == null) {
+            return null;
+        }
         List<Map<String, String>> staticRoutes = new ArrayList<Map<String, String>>();
         ConcurrentMap<String, StaticRouteConfig> routeConfigs = staticRouting
                 .getStaticRouteConfigs();
index 2d6b6bb..f92e596 100644 (file)
@@ -162,7 +162,7 @@ one.f.detail = {
                        var body = [];
                        var tr = {};
                        var entry = [];
-
+                        entry.push(data['flow']['ingressPort']);
                        entry.push(data['flow']['etherType']);
                        entry.push(data['flow']['vlanId']);
                        entry.push(data['flow']['vlanPriority']);
@@ -212,7 +212,7 @@ one.f.detail = {
             return $table;
         },
                description : function(body) {
-                       var header = ['Ethernet Type', 'VLAN ID', 'VLAN Priority', 'Source MAC', 'Dest MAC', 'Source IP', 'Dest IP', 'TOS', 'Source Port', 'Dest Port', 'Protocol', 'Cookie'];
+                       var header = ['Input Port', 'Ethernet Type', 'VLAN ID', 'VLAN Priority', 'Source MAC', 'Dest MAC', 'Source IP', 'Dest IP', 'TOS', 'Source Port', 'Dest Port', 'Protocol', 'Cookie'];
                        var $thead = one.lib.dashlet.table.header(header);
                        var attributes = ['table-striped', 'table-bordered', 'table-condensed'];
                        var $table = one.lib.dashlet.table.table(attributes);