From 58514901716884f4d364f2bdae6010ebc651e7e4 Mon Sep 17 00:00:00 2001 From: Andrew Kim Date: Tue, 7 May 2013 18:37:45 -0700 Subject: [PATCH] Fix NPE and enhance flows table NPE in devices web caused loop in JS Added ingress port to flows table Signed-off-by: Andrew Kim --- .../java/org/opendaylight/controller/devices/web/Devices.java | 3 +++ opendaylight/web/flows/src/main/resources/js/page.js | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java index 1102a6382e..ec59ab740b 100644 --- a/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java +++ b/opendaylight/web/devices/src/main/java/org/opendaylight/controller/devices/web/Devices.java @@ -207,6 +207,9 @@ public class Devices implements IDaylightWeb { IForwardingStaticRouting staticRouting = (IForwardingStaticRouting) ServiceHelper .getInstance(IForwardingStaticRouting.class, containerName, this); + if (staticRouting == null) { + return null; + } List> staticRoutes = new ArrayList>(); ConcurrentMap routeConfigs = staticRouting .getStaticRouteConfigs(); diff --git a/opendaylight/web/flows/src/main/resources/js/page.js b/opendaylight/web/flows/src/main/resources/js/page.js index 2d6b6bb4c5..f92e596b0a 100644 --- a/opendaylight/web/flows/src/main/resources/js/page.js +++ b/opendaylight/web/flows/src/main/resources/js/page.js @@ -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); -- 2.36.6