Skip to content

Commit

Permalink
Merge "Closes-Bug: #1418476 - The response data was getting updated e…
Browse files Browse the repository at this point in the history
…ven before the subscription to it to update the infobox was made. Because of this the infoboxes were not getting updated with the correct up and down count. Fixed it by moving this subscription before we subscribe for the data change." into R2.0
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Mar 25, 2015
2 parents ca1fe1d + 013952c commit 56e9cc6
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions webroot/js/dashboard-utils.js
Expand Up @@ -13,7 +13,7 @@ function infraMonitorClass() {
$.each(downSelectors,function(idx,elem) {
if($(elem).text() == "0")
$(elem).hide();
else
else
$(elem).show();
});
}
Expand Down Expand Up @@ -132,20 +132,21 @@ function infraMonitorClass() {
var result = nodeDS.getDataSourceObj();
var dataSource = result['dataSource'];
var deferredObj = result['deferredObj'];
//if cached data is available trigger event to update
if(result['lastUpdated'] != null && (result['error'] == null || result['error']['errTxt'] == 'abort')){
triggerDatasourceEvents(nodeDS);
}
infoBoxObj['viewModel'].downCnt.subscribe(function(newValue) {
showHideDownNodeCnt();
});
//Update the viewModel
$(nodeDS).on('change',function() {
var data = dataSource.getItems();
obj['viewModel'].data(data);
self.updateInfoBoxes();
self.updateAlerts();
});
//if cached data is available trigger event to update
if(result['lastUpdated'] != null && (result['error'] == null || result['error']['errTxt'] == 'abort')){
triggerDatasourceEvents(nodeDS);
}
infoBoxObj['viewModel'].downCnt.subscribe(function(newValue) {
showHideDownNodeCnt();
});

}

function loadLogs() {
Expand Down

0 comments on commit 56e9cc6

Please sign in to comment.