Change the repo view page to minimize the number of API calls necessary until such time as the information is needed (lazy load everything). Also increase the build timer to 30s.
This commit is contained in:
parent
03481261e8
commit
c04cb4e988
9 changed files with 91 additions and 23 deletions
|
@ -10,7 +10,8 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository',
|
||||
'builds': '=builds'
|
||||
'builds': '=builds',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, $filter, $routeParams, ApiService, TriggerService, UserService) {
|
||||
var orderBy = $filter('orderBy');
|
||||
|
@ -58,7 +59,7 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
};
|
||||
|
||||
var loadBuilds = function(opt_forcerefresh) {
|
||||
if (!$scope.builds || !$scope.repository || !$scope.options.filter) {
|
||||
if (!$scope.builds || !$scope.repository || !$scope.options.filter || !$scope.isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -101,7 +102,7 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!$scope.builds || !$scope.repository) {
|
||||
if (!$scope.builds || !$scope.repository || !$scope.isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -133,7 +134,7 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
};
|
||||
|
||||
var loadBuildTriggers = function() {
|
||||
if (!$scope.repository || !$scope.repository.can_admin) { return; }
|
||||
if (!$scope.repository || !$scope.repository.can_admin || !$scope.isEnabled) { return; }
|
||||
|
||||
var params = {
|
||||
'repository': $scope.repository.namespace + '/' + $scope.repository.name
|
||||
|
@ -157,6 +158,9 @@ angular.module('quay').directive('repoPanelBuilds', function () {
|
|||
$scope.$watch('repository', loadBuildTriggers);
|
||||
$scope.$watch('repository', loadBuilds);
|
||||
|
||||
$scope.$watch('isEnabled', loadBuildTriggers);
|
||||
$scope.$watch('isEnabled', loadBuilds);
|
||||
|
||||
$scope.$watch('builds', buildsChanged);
|
||||
|
||||
$scope.$watch('options.filter', loadBuilds);
|
||||
|
|
|
@ -9,7 +9,8 @@ angular.module('quay').directive('repoPanelSettings', function () {
|
|||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository'
|
||||
'repository': '=repository',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, Config) {
|
||||
$scope.getBadgeFormat = function(format, repository) {
|
||||
|
|
|
@ -10,13 +10,15 @@ angular.module('quay').directive('repositoryEventsTable', function () {
|
|||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository'
|
||||
'repository': '=repository',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, Restangular, UtilService, ExternalNotificationData) {
|
||||
$scope.showNewNotificationCounter = 0;
|
||||
|
||||
var loadNotifications = function() {
|
||||
if (!$scope.repository || $scope.notificationsResource) { return; }
|
||||
if (!$scope.repository || $scope.notificationsResource || !$scope.isEnabled) { return; }
|
||||
|
||||
var params = {
|
||||
'repository': $scope.repository.namespace + '/' + $scope.repository.name
|
||||
};
|
||||
|
@ -29,6 +31,8 @@ angular.module('quay').directive('repositoryEventsTable', function () {
|
|||
};
|
||||
|
||||
$scope.$watch('repository', loadNotifications);
|
||||
$scope.$watch('isEnabled', loadNotifications);
|
||||
|
||||
loadNotifications();
|
||||
|
||||
$scope.handleNotificationCreated = function(notification) {
|
||||
|
|
|
@ -25,7 +25,8 @@ angular.module('quay').directive('repositoryPermissionsTable', function () {
|
|||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository'
|
||||
'repository': '=repository',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, Restangular, UtilService) {
|
||||
$scope.permissionResources = {'team': {}, 'user': {}};
|
||||
|
@ -34,7 +35,8 @@ angular.module('quay').directive('repositoryPermissionsTable', function () {
|
|||
$scope.addPermissionInfo = {};
|
||||
|
||||
var loadAllPermissions = function() {
|
||||
if (!$scope.repository) { return; }
|
||||
if (!$scope.repository || !$scope.isEnabled) { return; }
|
||||
|
||||
fetchPermissions('user');
|
||||
fetchPermissions('team');
|
||||
};
|
||||
|
@ -58,6 +60,8 @@ angular.module('quay').directive('repositoryPermissionsTable', function () {
|
|||
};
|
||||
|
||||
$scope.$watch('repository', loadAllPermissions);
|
||||
$scope.$watch('isEnabled', loadAllPermissions);
|
||||
|
||||
loadAllPermissions();
|
||||
|
||||
var getPermissionEndpoint = function(entityName, kind) {
|
||||
|
|
|
@ -11,13 +11,14 @@ angular.module('quay').directive('repositoryTokensTable', function () {
|
|||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository',
|
||||
'hasTokens': '=hasTokens'
|
||||
'hasTokens': '=hasTokens',
|
||||
'isEnabled': '=isEnabled'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, Restangular, UtilService) {
|
||||
$scope.hasTokens = false;
|
||||
|
||||
var loadTokens = function() {
|
||||
if (!$scope.repository || $scope.tokensResource) { return; }
|
||||
if (!$scope.repository || $scope.tokensResource || !$scope.isEnabled) { return; }
|
||||
var params = {
|
||||
'repository': $scope.repository.namespace + '/' + $scope.repository.name
|
||||
};
|
||||
|
@ -28,7 +29,9 @@ angular.module('quay').directive('repositoryTokensTable', function () {
|
|||
}, ApiService.errorDisplay('Could not load access tokens'));
|
||||
};
|
||||
|
||||
$scope.$watch('isEnabled', loadTokens);
|
||||
$scope.$watch('repository', loadTokens);
|
||||
|
||||
loadTokens();
|
||||
|
||||
$scope.deleteToken = function(tokenCode) {
|
||||
|
|
Reference in a new issue