From cc7a93fa2e349e9ac4d6fe6e8390d2bd0c634053 Mon Sep 17 00:00:00 2001 From: balamurugang Date: Wed, 4 May 2016 16:32:37 +0530 Subject: [PATCH] Fixed bugs id's 1554415, 1437197, 1550334 Bug ID 1554415 Pending 1. Double-clicking on link doesn't work if cursor pointer changes to default while tooltip shown 9. disable tooltip for links between vrouter & vms..as no added information is shown in tooltip. - Tracked in another Bug ID : 1543988 Fixed in this commit 2. VM IP is shown in grid but vm name is shown in topology..difficult to co-relate 3. No need to show "Direction" in grid as all flows we show are "INGRESS". - removed from getSearchFlowGridColumns - removed from getTraceFlowVrouterGridColumns - removed from getTraceFlowVMGridColumns 5. "Show Underlay Path(s)" : No need of (s) 6. First source vrouter need to be then destination vrouter, but here we show first "Other Virtual Router" & "Virtual Router" - Done in getSearchFlowGridColumns & getTraceFlowVMGridColumns 10. [Firefox] pRouter Details: Clicking on Interface count link opens a new empty tab. Allready Done 4. When "Trace Flow" is shown, clicking on "pRouters" doesn't work. 7. Cursor doesn't change to "Hand" pointer, on clicking grid title. 8. For link, we show interface names in tooltip..can also show along which prouter/vrouter that interface belongs to. Partial-Bug: #1554415 Bug ID : 1437197 UI:'Other Virtual Router ' name is mis-leading in 'trace flow ' page as the tunnel end-point could be mx /any rouer as well Fixed by changing the name to Encapsulation Endpoint Closes-Bug: #1437197 Bug ID : 1550334 UI underlay topology: Fip is not shown in tooltip for a VM Fixed it. Now showing the floating ip detail. Closes-Bug: #1550334 Change-Id: I1e6f5302e1d9f540920e959164ff67462e817b1b Closes-Bug: #1550334 --- .../underlay/ui/js/underlay.utils.js | 124 +++++++----------- .../ui/js/views/SearchFlowResultView.js | 2 +- .../underlay/ui/js/views/UnderlayGraphView.js | 12 ++ .../underlay/ui/js/views/UnderlayTabView.js | 3 +- 4 files changed, 63 insertions(+), 78 deletions(-) diff --git a/webroot/monitor/infrastructure/underlay/ui/js/underlay.utils.js b/webroot/monitor/infrastructure/underlay/ui/js/underlay.utils.js index a49320732..4f3822b7a 100644 --- a/webroot/monitor/infrastructure/underlay/ui/js/underlay.utils.js +++ b/webroot/monitor/infrastructure/underlay/ui/js/underlay.utils.js @@ -206,7 +206,8 @@ define(['underscore'], function (_) { viewConfig: { header: { title: - contrail.format('Traffic Statistics of {0}',vrouter), + contrail.format('Traffic Statistics of {0} -- {1}', + data['sourceElement']['name'], vrouter) }, controls: { top: { @@ -328,7 +329,7 @@ define(['underscore'], function (_) { return [ { field:'peer_vrouter', - name:"Other Virtual Router", + name:"Encapsulation Endpoint", minWidth:170, formatter: function(r,c,v,cd,dc){ var name = $.grep(computeNodes,function(value,idx){ @@ -366,27 +367,12 @@ define(['underscore'], function (_) { name:"Source IP", minWidth:60, formatter:function(r,c,v,cd,dc) { - if(validateIPAddress(dc['sip'])) - return dc['sip'] - else - noDataStr; + return self.parseDestination(dc['sip']); } },{ field:"src_port", name:"Source Port", minWidth:50 - },{ - field:"direction", - name:"Direction", - minWidth:40, - formatter: function(r,c,v,cd,dc) { - if (dc['direction'] == 'ingress') - return 'INGRESS' - else if (dc['direction'] == 'egress') - return 'EGRESS' - else - return '-'; - } },{ field:"dst_vn", name:"Destination Network", @@ -401,10 +387,7 @@ define(['underscore'], function (_) { name:"Destination IP", minWidth:60, formatter:function(r,c,v,cd,dc) { - if(validateIPAddress(dc['dip'])) - return dc['dip'] - else - noDataStr; + return self.parseDestination(dc['dip']); } },{ field:"dst_port", @@ -428,14 +411,14 @@ define(['underscore'], function (_) { self.getTraceFlowVMGridColumns = function () { return [ { - field: 'formattedOtherVrouter', - name: "Other Virtual Router", - minWidth:170, - },{ field: 'formattedVrouter', name: "Virtual Router", minWidth:170, - },{ + }, { + field: 'formattedOtherVrouter', + name: "Encapsulation Endpoint", + minWidth:170, + }, { field:"protocol", name:"Protocol", minWidth:40, @@ -449,29 +432,14 @@ define(['underscore'], function (_) { },{ field:"sourceip", name:"Source IP", - minWidth:60, + minWidth:100, formatter:function(r,c,v,cd,dc) { - if(validateIPAddress(dc['sourceip'])) - return dc['sourceip'] - else - noDataStr; + return self.parseDestination(dc['sourceip']); } },{ field:"sport", name:"Source Port", minWidth:50 - },{ - field:"direction_ing", - name:"Direction", - minWidth:40, - formatter: function(r,c,v,cd,dc) { - if (dc['direction_ing'] == 1) - return 'INGRESS' - else if (dc['direction_ing'] == 0) - return 'EGRESS' - else - return '-'; - } },{ field:"formattedDestVN", name:"Destination Network", @@ -486,10 +454,7 @@ define(['underscore'], function (_) { name:"Destination IP", minWidth:60, formatter:function(r,c,v,cd,dc) { - if(validateIPAddress(dc['destip'])) - return dc['destip'] - else - noDataStr; + return self.parseDestination(dc['destip']); } },{ field:"dport", @@ -513,13 +478,13 @@ define(['underscore'], function (_) { self.getSearchFlowGridColumns = function () { return [ { - field: 'formattedOtherVrouter', - name: "Other Virtual Router", - minWidth:170, - },{ field: 'formattedVrouter', name: "Virtual Router", - minWidth:170, + minWidth:160, + },{ + field: 'formattedOtherVrouter', + name: "Encapsulation Endpoint", + minWidth:160, },{ field:"protocol", name:"Protocol", @@ -534,29 +499,14 @@ define(['underscore'], function (_) { },{ field:"sourceip", name:"Source IP", - minWidth:60, + minWidth:100, formatter:function(r,c,v,cd,dc) { - if(validateIPAddress(dc['sourceip'])) - return dc['sourceip'] - else - noDataStr; + return self.parseDestination(dc['sourceip']); } },{ field:"sport", name:"Source Port", minWidth:50 - },{ - field:"direction_ing", - name:"Direction", - minWidth:40, - formatter: function(r,c,v,cd,dc) { - if (dc['direction_ing'] == 1) - return 'INGRESS' - else if (dc['direction_ing'] == 0) - return 'EGRESS' - else - return '-'; - } },{ field:"formattedDestVN", name:"Destination Network", @@ -569,12 +519,9 @@ define(['underscore'], function (_) { },{ field:"destip", name:"Destination IP", - minWidth:60, + minWidth:100, formatter:function(r,c,v,cd,dc) { - if(validateIPAddress(dc['destip'])) - return dc['destip'] - else - noDataStr; + return self.parseDestination(dc['destip']); } },{ field:"dport", @@ -598,7 +545,32 @@ define(['underscore'], function (_) { self.getUnderlayGraphModel = function () { return $("#"+ctwl.UNDERLAY_GRAPH_ID).data('graphModel'); }; - + self.parseDestination = function(ip) { + if (validateIPAddress(ip)) { + var vmName = self.getVMForIP(ip); + if (vmName != "") { + return ip + " (" + vmName + ")"; + } else { + return ip; + } + } else { + noDataStr; + } + }; + self.getVMForIP = function (ip) { + var nodeModels = + $("#"+ctwl.UNDERLAY_GRAPH_ID).data('graphModel'). + nodesCollection.models; + var nm = _.filter(nodeModels, function(node) { + return (_.pluck(node.attributes.more_attributes().interface_list, + 'ip_address').indexOf(ip) != -1); + }); + if(nm && nm.length == 1) { + nm = nm[0]; + return nm.attributes.label() + } + return ""; + }; /*self.showFlowPath = function (connectionWrapIds, offsetWidth, graphView) { if(offsetWidth == null) offsetWidth = 5; diff --git a/webroot/monitor/infrastructure/underlay/ui/js/views/SearchFlowResultView.js b/webroot/monitor/infrastructure/underlay/ui/js/views/SearchFlowResultView.js index 165f5f57a..f8fae75f7 100644 --- a/webroot/monitor/infrastructure/underlay/ui/js/views/SearchFlowResultView.js +++ b/webroot/monitor/infrastructure/underlay/ui/js/views/SearchFlowResultView.js @@ -89,7 +89,7 @@ define([ detail: false, actionCellPosition: 'start', actionCell:[{ - title: 'Show Underlay Path(s)', + title: 'Show Underlay Path', iconClass: 'icon-contrail-trace-flow', onClick: function(rowIndex,targetElement){ var graphModel = underlayUtils.getUnderlayGraphModel(); diff --git a/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayGraphView.js b/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayGraphView.js index 93f72cf95..bf7cc110e 100644 --- a/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayGraphView.js +++ b/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayGraphView.js @@ -1726,6 +1726,8 @@ define([ label, instanceName = ""; var instanceUUID = node.attributes.name(); var instances = graphModel.getVirtualMachines(); + var fip_addr = ""; + var fip_addr_arr = []; for (var i = 0; i < instances.length; i++) { if (instances[i].attributes.name() === instanceUUID) { var attributes = ifNull(instances[i].attributes.more_attributes(), {}), @@ -1741,6 +1743,9 @@ define([ ipArr.push(interfaceList[j]['ip6_address']); else if (interfaceList[j]['ip_address'] != '0.0.0.0') ipArr.push(interfaceList[j]['ip_address']); + fip_addr_arr = getValueByJsonPath(interfaceList[j], "floating_ips", []); + if (fip_addr != "") fip_addr += ", "; + fip_addr += _.pluck(fip_addr_arr, 'ip_address').join(', '); } if (ipArr.length > 0) vmIp = ipArr.join(); @@ -1775,6 +1780,13 @@ define([ value: vn }); } + + if (fip_addr != "") { + tooltipLblValues.push({ + label: "Floating IP(s)", + value: fip_addr + }); + } tooltipContent['info'] = tooltipLblValues; return tooltipContentTmpl(tooltipContent); } diff --git a/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayTabView.js b/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayTabView.js index bb62e22c8..daf6c9c53 100644 --- a/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayTabView.js +++ b/webroot/monitor/infrastructure/underlay/ui/js/views/UnderlayTabView.js @@ -152,7 +152,8 @@ define([ // onAllViewsRenderComplete callback is executed when // all the tabs are rendered hence interface click // handler is bind in the interface tabs callback - $("#details .intfCnt").click(function () { + $("#details .intfCnt").click(function (e) { + e.preventDefault(); $("#"+ctwc.UNDERLAY_TAB_ID).tabs({active:3}); }) }