Skip to content

Commit

Permalink
resolve issue with distinct values on bgp_updates page
Browse files Browse the repository at this point in the history
  • Loading branch information
pgigis committed Apr 9, 2019
1 parent eb8d239 commit f46abe5
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions frontend/webapp/views/main/templates/bgpupdates.htm
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ <h1>Additional actions</h1>
datatable_parameters['and'] = ' where: { _and: [' + filters.join() + '] }';
hasura['extra']['table_name'] = "view_bgpupdates";
}else{
datatable_parameters['and'] = 'args: {' + as_path + '} , where: { _and: [' + filters.join() + '] }';
datatable_parameters['and'] = 'args: {' + as_path + '}, where: { _and: [' + filters.join() + '] }';
hasura['extra']['table_name'] = "search_bgpupdates_as_path";
}
downloadTable_parameters = '(' + download_filters.join() + ')';
Expand Down Expand Up @@ -696,13 +696,24 @@ <h1>Additional actions</h1>
return;
}

var query = "{ view_data: view_bgpupdates(distinct_on: [" + distinct_on + "] ";
var query = [];
if(filter_parameters['as_path'] != null){
query.push("{ view_data: search_bgpupdates_as_path(distinct_on: [");
}else{
query.push("{ view_data: view_bgpupdates(distinct_on: [");
}
query.push(distinct_on);
query.push("] ");
if(datatable_parameters['and'] != null){
query += datatable_parameters['and'] + ")";
query.push(datatable_parameters['and']);
query.push(")");
}else{
query += ")";
query.push(")");
}
query += " { " + distinct_on + " } }";
query.push(" { ");
query.push(distinct_on);
query.push(" } }");

fetchDistinctValues(distinct_on, query);
});

Expand Down

0 comments on commit f46abe5

Please sign in to comment.