Limit robots displayed in entity search
Before, we'd load *all* the robots, which can be a huge issue in namespaces with a large number of robots. Now, we only load the top-20 robots (as per recency in login), and we also limit the information returned to the entity search to save some bandwidth. Fixes https://jira.coreos.com/browse/QUAY-927
This commit is contained in:
parent
7878435805
commit
5c50161d85
7 changed files with 121 additions and 26 deletions
|
@ -121,8 +121,12 @@ angular.module('quay').directive('entitySearch', function () {
|
|||
// Load the user/organization's robots (if applicable).
|
||||
if ($scope.isAdmin && isSupported('robot')) {
|
||||
requiredOperations++;
|
||||
|
||||
ApiService.getRobots($scope.isOrganization ? $scope.namespace : null).then(function(resp) {
|
||||
var params = {
|
||||
'token': false,
|
||||
'limit': 20
|
||||
};
|
||||
|
||||
ApiService.getRobots($scope.isOrganization ? $scope.namespace : null, null, params).then(function(resp) {
|
||||
$scope.page.robots = resp.robots;
|
||||
operationComplete();
|
||||
}, operationComplete);
|
||||
|
|
|
@ -71,7 +71,7 @@ angular.module('quay').factory('ApiService', ['Restangular', '$q', 'UtilService'
|
|||
if (used[paramName]) { continue; }
|
||||
|
||||
var value = parameters[paramName];
|
||||
if (value) {
|
||||
if (value != null) {
|
||||
url += isFirst ? '?' : '&';
|
||||
url += paramName + '=' + encodeURIComponent(value)
|
||||
isFirst = false;
|
||||
|
|
Reference in a new issue