Skip to content

Commit

Permalink
Closes-Bug: #1463324
Browse files Browse the repository at this point in the history
Here, vRotuer data source is updated sequentially, like in 1st call, all
the basic details are fetched and in the second call generators
information is fetched.
As the scatter chart doesn't need information from generators to render,
earlier a check was added not to render scatterchart while updating
datasource with just generators information, which is blocking updating
scatterchart with local cache that has generators information
Commented this check

Change-Id: Ifdf62acca34ba7b1091d9eeed88594fe97426e65
  • Loading branch information
knagakiran committed Jun 11, 2015
1 parent 0508e93 commit e160415
Showing 1 changed file with 20 additions and 14 deletions.
Expand Up @@ -6,6 +6,7 @@
* vRouters Summary Page
*/
monitorInfraComputeSummaryClass = (function() {
var crossFilterInitialized = false;
var computeNodesGrid,vRoutersData = [];
var vRouterDataWithStatusInfo = [];
var filteredNodeNames = [];
Expand Down Expand Up @@ -43,14 +44,16 @@ monitorInfraComputeSummaryClass = (function() {
filteredNodeNames.push(obj['name']);
});
computeNodesGrid = $('#divcomputesgrid').data('contrailGrid');
computeNodesGrid._dataView.setFilterArgs({
filteredNodeNames:filteredNodeNames
});
computeNodesGrid._dataView.setFilter(function(item,args) {
if($.inArray(item['name'],args['filteredNodeNames']) > -1)
return true;
return false;
});
if(computeNodesGrid != null && computeNodesGrid._dataView != null) {
computeNodesGrid._dataView.setFilterArgs({
filteredNodeNames:filteredNodeNames
});
computeNodesGrid._dataView.setFilter(function(item,args) {
if($.inArray(item['name'],args['filteredNodeNames']) > -1)
return true;
return false;
});
}

//update the header
var totalCnt = vRoutersDataSource.getItems().length;
Expand All @@ -62,7 +65,7 @@ monitorInfraComputeSummaryClass = (function() {
var vRouterData = result['data'];
var source = result['cfg']['source'];
//Do not update crossfilters if the update request also came from crossfilter or because of a generator update
if(source == 'crossfilter' || source == 'generator'){
if(source == 'crossfilter') {
return;
}
$('.chart > svg').remove();
Expand Down Expand Up @@ -151,10 +154,12 @@ monitorInfraComputeSummaryClass = (function() {
function updatevRouterSummaryCharts(result){
var filteredNodes = result['data'];
var source = result['cfg']['source'];
//if the callback is because of an update to generator then dont update the charts
if(source == 'generator'){
return;
}
//If the callback is because of an update to generator then dont update the charts
//Putting this check is not updating the charts on coming to this page and local cache is already available with
//generators information
// if(source == 'generator'){
// return;
// }
updateChartsForSummary(filteredNodes,'compute');
}

Expand Down Expand Up @@ -198,7 +203,8 @@ monitorInfraComputeSummaryClass = (function() {
if(filteredNodes[0] != null && filteredNodes[0]['isGeneratorRetrieved'] == true){
source = 'generator';
}
if(source != 'generator'){
if(crossFilterInitialized == false) {
crossFilterInitialized = true;
manageCrossFilters.updateCrossFilter('vRoutersCF',filteredNodes);
//Add current crossfilters dimensions again as they will be lost on crossfilter reset
manageCrossFilters.addDimension('vRoutersCF','intfCnt');
Expand Down

0 comments on commit e160415

Please sign in to comment.