Skip to content

Commit

Permalink
Related-bug:#1449860
Browse files Browse the repository at this point in the history
In search flow we are fetching all the records and displaying, restricted the page size to 10,so that map flow button and topology will be visible even though we scroll down

Change-Id: Id5541580ef85046526460d2f7d39dc935991f646
  • Loading branch information
vishnuvv committed May 5, 2015
1 parent ab95ad9 commit 19bce00
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions webroot/monitor/infra/underlay/ui/js/flow_queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,13 +728,11 @@ function runFRQuery() {
columnDisplay, selectArray, queryId;
//if ($("#" + queryPrefix + "-query-form").valid()) {
//collapseWidget('#fr-query-widget');
queryId = randomUUID();
collapseWidget('#fr-query-widget');
var option = {};
reqQueryObj = setUTCTimeObj('fr', reqQueryObj, option);
reqQueryObj.table = 'FlowRecordTable';
reqQueryObj.queryId = queryId;
reqQueryObj.async = 'true';
reqQueryObj.async = 'false';
selectArray = parseStringToArray(select, ',');
selectArray = selectArray.concat(queries['fr']['defaultColumns']);
columnDisplay = getColumnDisplay4Grid(queries['fr']['columnDisplay'], selectArray, true);
Expand Down Expand Up @@ -786,7 +784,9 @@ function viewFRQueryResults(dataItem, params) {
function loadFlowResultsForUnderlay(options, reqQueryObj, columnDisplay, fcGridDisplay,reverseTraceFlow) {
var grid = $('#' + options.elementId).data('contrailGrid'),
url = "/api/admin/reports/query",
btnId = options.btnId;
btnId = options.btnId,
dataView = new ContrailDataView(),
gridObject;

var gridConfig = {
header: {
Expand All @@ -808,16 +808,7 @@ function loadFlowResultsForUnderlay(options, reqQueryObj, columnDisplay, fcGridD
forceFitColumns: true,
},
dataSource : {
remote: {
ajaxConfig: {
url: url,
timeout: options.timeOut,
type: "POST",
data: reqQueryObj
},
serverSidePagination: true,
exportFunction: exportServersideQueryResults
},
dataView: dataView,
events : {
onRequestStartCB : function() {
onQueryRequestStart(btnId);
Expand Down Expand Up @@ -878,7 +869,6 @@ function loadFlowResultsForUnderlay(options, reqQueryObj, columnDisplay, fcGridD
}
}
};

if(options.queryPrefix == 'fs'){
if (grid) {
$('#ts-chart').empty();
Expand Down Expand Up @@ -915,7 +905,8 @@ function loadFlowResultsForUnderlay(options, reqQueryObj, columnDisplay, fcGridD
$(e['currentTarget']).attr('checked',true);
}
},
actionCell: []
actionCell: [],
lazyLoading:true,
};
$("#mapflow").die('click').live('click',function(e){
var startTime = $("#"+options.queryPrefix+"-results").data('startTimeUTC');
Expand All @@ -927,8 +918,22 @@ function loadFlowResultsForUnderlay(options, reqQueryObj, columnDisplay, fcGridD
showUnderlayPaths(dataItem);
});
}

$("#" + options.elementId).contrailGrid(gridConfig);
gridObject = $("#"+options.elementId).data('contrailGrid');
$.ajax({
url:url+'?'+$.param(reqQueryObj),
}).done(function(response){
dataView.setData(response['data']);
if(response['data'].length == 0 && gridObject != null) {
gridObject.showGridMessage('empty');
}
}).fail(function(error){
if(gridObject != null) {
gridObject.showGridMessage('error');
}
}).always(function() {
$("#" + options.elementId).find('.grid-header-icon-loading').hide();
});
$("#" + options.elementId).find('input.headerRowCheckbox').parent('span').remove();
$('#fs-results').find('a[data-action="collapse"]').on('click', function(){
if($(this).find('i.collapse-icon').hasClass('icon-chevron-up')){
Expand All @@ -948,7 +953,7 @@ function loadFlowResultsForUnderlay(options, reqQueryObj, columnDisplay, fcGridD
function getFRDefaultOptions() {
return {
elementId:'fr-results', gridHeight:480,
timeOut:60000, pageSize:15, queryPrefix:'fr', export:true,
timeOut:60000, pageSize:10, queryPrefix:'fr', export:true,
btnId:'fr-query-submit'
};
};
Expand Down

0 comments on commit 19bce00

Please sign in to comment.