diff --git a/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.parsers.js b/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.parsers.js index 618f3e5e8..e1ad7089e 100644 --- a/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.parsers.js +++ b/webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.parsers.js @@ -1726,6 +1726,7 @@ define( var origResponse = response; var isFromACLFlows = false; var ret = []; + var lastFlowReq = false; response = jsonPath(origResponse,"$..SandeshFlowData")[0]; if (response == null){ isFromACLFlows = true; @@ -1733,15 +1734,6 @@ define( } var flowKey = jsonPath(origResponse,"$..flow_key")[0]; var iterationKey = jsonPath(origResponse,"$..iteration_key")[0]; - // var retArr = []; - /* for (var i = 0; i < response.length; i++) { - var currACL = response[i]; - for (var j = 0; j < currACL['flowData'].length; j++) { - var currFlow = currACL['flowData'][j]; - var aclUuid = currACL['acl_uuid']; - retArr.push($.extend(currFlow, {acl_uuid:aclUuid})); - } - }*/ if( response != null ){ if(!(response instanceof Array)){ response = [response]; @@ -1793,23 +1785,23 @@ define( if(flowKey != null && !$.isEmptyObject(flowKey)){ //Had to add this hack because sometimes we get into to //this parse function twice leading this to be added twice to the stack - if(flowKey != "0:0:0:0:0.0.0.0:0.0.0.0" && + if(flowKey != "0-0-0-0-0-0.0.0.0-0.0.0.0" && flowKeyStack[flowKeyStack.length - 1] != flowKey) flowKeyStack.push(flowKey); } - if((flowKey == null) || (flowKey == "0:0:0:0:0.0.0.0:0.0.0.0")) { + if((flowKey == null) || (flowKey == "0-0-0-0-0-0.0.0.0-0.0.0.0")) { lastFlowReq = true; } //Push the aclIterKey to the stack for Next use if(iterationKey != null && !$.isEmptyObject(iterationKey)){ //Had to add this hack because sometimes we get into to //this parse function twice leading this to be added twice to the stack - if(iterationKey.indexOf('0:0:0:0:0.0.0.0:0.0.0.0') == -1 && + if(iterationKey.indexOf('0-0-0-0-0-0.0.0.0-0.0.0.0') == -1 && aclIterKeyStack[aclIterKeyStack.length - 1] != iterationKey) aclIterKeyStack.push(iterationKey); } //$('#flowCnt').text(response.flowData.length); - return ret; + return {data:ret,lastFlowReq:lastFlowReq}; } self.mergeACLAndSGData = function(sgData,aclListModel) { diff --git a/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsFormView.js b/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsFormView.js index 8698b925e..25abad3e6 100644 --- a/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsFormView.js +++ b/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsFormView.js @@ -12,6 +12,7 @@ define([ ], function (_, Knockback, ContrailView, ContrailListModel, VRouterFlowsFormModel) { var VRouterFlowsFormView = ContrailView.extend({ + lastFlowReq : false, render: function (options) { var self = this, viewConfig = self.attributes.viewConfig, hostname = viewConfig['hostname'], @@ -93,7 +94,7 @@ define([ ajaxConfig : remoteConfig, dataParser : function(response) { var retData = monitorInfraParsers.parseVRouterFlowsData(response); - return retData; + return retData['data']; } }, cacheConfig : { @@ -108,6 +109,7 @@ define([ function onSelectAcl(acluuid) { var flowGrid = $('#' + ctwl.VROUTER_FLOWS_GRID_ID).data('contrailGrid'); var newAjaxConfig = ""; + self.lastFlowReq = false; flowKeyStack = []; aclIterKeyStack = []; if (acluuid != 'All') { @@ -129,8 +131,9 @@ define([ // reloadGrid(flowGrid); $.ajax(newAjaxConfig).done(function(response) { var retData = monitorInfraParsers.parseVRouterFlowsData(response,acluuid); + self.lastFlowReq = retData.lastFlowReq; if(flowGrid._dataView != null) - flowGrid._dataView.setData(retData); + flowGrid._dataView.setData(retData['data']); flowGrid.refreshView(); }); } @@ -139,6 +142,9 @@ define([ var flowGrid = $('#' + ctwl.VROUTER_FLOWS_GRID_ID).data('contrailGrid'); var acluuid = self.model.acl_uuid(); var newAjaxConfig = ""; + if(self.lastFlowReq) { + return; + } isAllPrevFirstTimeClicked = true; isAclPrevFirstTimeClicked = true; if(acluuid == 'All' && flowKeyStack.length > 0 && @@ -172,8 +178,9 @@ define([ // reloadGrid(flowGrid); $.ajax(newAjaxConfig).done(function(response) { var retData = monitorInfraParsers.parseVRouterFlowsData(response,acluuid); + self.lastFlowReq = retData['lastFlowReq']; if(flowGrid._dataView != null) - flowGrid._dataView.setData(retData); + flowGrid._dataView.setData(retData['data']); flowGrid.refreshView(); }); } @@ -230,9 +237,10 @@ define([ // flowGrid.setRemoteAjaxConfig(newAjaxConfig); // reloadGrid(flowGrid); $.ajax(newAjaxConfig).done(function(response) { - var retData = monitorInfraParsers.parseVRouterFlowsData(response); + var retData = monitorInfraParsers.parseVRouterFlowsData(response,acluuid); + self.lastFlowReq = retData.lastFlowReq; if(flowGrid._dataView != null) - flowGrid._dataView.setData(retData,acluuid); + flowGrid._dataView.setData(retData['data'],acluuid); flowGrid.refreshView(); }); } diff --git a/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsGridView.js b/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsGridView.js index 5bc8f79b7..58bfa507d 100644 --- a/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsGridView.js +++ b/webroot/monitor/infrastructure/vrouter/ui/js/views/VRouterFlowsGridView.js @@ -12,15 +12,7 @@ define([ render: function () { var self = this, viewConfig = self.attributes.viewConfig; - self.renderView4Config(self.$el, self.model, self.getViewConfig(), - null,null,null, - function(){ - cowu.addGridGrouping ('vrouter_flows-results',{ - groupingField :"acl_uuid", - groupHeadingPrefix : 'ACL UUID: ', - rowCountSuffix : ['Flow','Flows'] - }); - }); + self.renderView4Config(self.$el, self.model, self.getViewConfig()); }, getViewConfig: function () { @@ -85,7 +77,7 @@ define([ searchFn: function(data) { return getAclSgUuuidString(data,true); }, - hide:true, +// hide:true, minWidth:280 }, { @@ -201,6 +193,7 @@ define([ checkboxSelectable: false, // fixedRowHeight: 30, sortable: false, + lazyLoading:false, detail: ctwu.getDetailTemplateConfigToDisplayRawJSON() }, dataSource: {