diff --git a/static/directives/repo-view/repo-panel-tags.html b/static/directives/repo-view/repo-panel-tags.html index edba94c3c..c47f9614e 100644 --- a/static/directives/repo-view/repo-panel-tags.html +++ b/static/directives/repo-view/repo-panel-tags.html @@ -244,7 +244,7 @@
+ manifest-digest="tag.manifest_digest" cache="labelCache"> diff --git a/static/js/directives/repo-view/repo-panel-tags.js b/static/js/directives/repo-view/repo-panel-tags.js index 82f877e9c..e1315e33b 100644 --- a/static/js/directives/repo-view/repo-panel-tags.js +++ b/static/js/directives/repo-view/repo-panel-tags.js @@ -36,6 +36,7 @@ angular.module('quay').directive('repoPanelTags', function () { $scope.tagsPerPage = 25; $scope.expandedView = false; + $scope.labelCache = {}; $scope.imageVulnerabilities = {}; $scope.defcon1 = {}; diff --git a/static/js/directives/ui/manifest-label-list.js b/static/js/directives/ui/manifest-label-list.js index 8cd5f1d11..cf42cda5f 100644 --- a/static/js/directives/ui/manifest-label-list.js +++ b/static/js/directives/ui/manifest-label-list.js @@ -11,6 +11,7 @@ angular.module('quay').directive('manifestLabelList', function () { scope: { 'repository': '=repository', 'manifestDigest': '=manifestDigest', + 'cache': '=cache' }, controller: function($scope, $element, ApiService) { $scope.labels = null; @@ -24,6 +25,11 @@ angular.module('quay').directive('manifestLabelList', function () { return; } + if ($scope.cache[$scope.manifestDigest]) { + $scope.labels = $scope.cache[$scope.manifestDigest]; + return; + } + $scope.labels = null; $scope.loadError = false; @@ -34,6 +40,7 @@ angular.module('quay').directive('manifestLabelList', function () { ApiService.listManifestLabels(null, params).then(function(resp) { $scope.labels = resp['labels']; + $scope.cache[$scope.manifestDigest] = resp['labels']; }, function() { $scope.loadError = true; });