Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix for the Nodes Learnt dashlet error when there are no ports in the topology.
[controller.git]
/
opendaylight
/
web
/
devices
/
src
/
main
/
resources
/
js
/
page.js
diff --git
a/opendaylight/web/devices/src/main/resources/js/page.js
b/opendaylight/web/devices/src/main/resources/js/page.js
index 37016860a790df5e02e1674178b318937544cc0c..a138eb909e58a185fffb133624225d12c2801d0d 100644
(file)
--- a/
opendaylight/web/devices/src/main/resources/js/page.js
+++ b/
opendaylight/web/devices/src/main/resources/js/page.js
@@
-321,9
+321,14
@@
one.f.switchmanager.nodesLearnt = {
' privilege=' + data.privilege + '>' + nodeNameEntry + '</a>';
var ports = item.ports;
' privilege=' + data.privilege + '>' + nodeNameEntry + '</a>';
var ports = item.ports;
+ var portsMatch = ports.match(/<\/span>/g);
+ var portsLength = 0;
+ if (portsMatch != null) {
+ portsLength = portsMatch.length;
+ }
item.ports = '<span class="nodePorts" style="cursor:pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId=' + item.nodeId
+ ' nodeName=' + nodeName
item.ports = '<span class="nodePorts" style="cursor:pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId=' + item.nodeId
+ ' nodeName=' + nodeName
- + '>' + ports
.match(/<\/span>/g).length
+'</span>';
+ + '>' + ports
Length
+'</span>';
});
},
delay: 0
});
},
delay: 0
@@
-364,9
+369,14
@@
one.f.switchmanager.nodesLearnt = {
formatter: function(items) {
$.each(items, function (index, item) {
var ports = item.ports;
formatter: function(items) {
$.each(items, function (index, item) {
var ports = item.ports;
+ var portsMatch = ports.match(/<\/span>/g);
+ var portsLength = 0;
+ if (portsMatch != null) {
+ portsLength = portsMatch.length;
+ }
item.ports = '<span class="nodePorts" style="cursor: pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId=' + item.nodeId
+ ' nodeName=' + item.nodeName
item.ports = '<span class="nodePorts" style="cursor: pointer;color: #08c" ports='+encodeURIComponent(JSON.stringify(item.ports)) + ' nodeId=' + item.nodeId
+ ' nodeName=' + item.nodeName
- + '>' + ports
.match(/<\/span>/g).length
+'</span>';
+ + '>' + ports
Length
+'</span>';
});
},
delay: 0
});
},
delay: 0