Add UI for viewing labels on a manifest in the tags view
This commit is contained in:
parent
69e476b1f4
commit
f17ef4adda
13 changed files with 336 additions and 112 deletions
47
static/js/directives/ui/manifest-label-list.js
Normal file
47
static/js/directives/ui/manifest-label-list.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* An element which displays the labels on a repository manifest.
|
||||
*/
|
||||
angular.module('quay').directive('manifestLabelList', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/manifest-label-list.html',
|
||||
replace: false,
|
||||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'repository': '=repository',
|
||||
'manifestDigest': '=manifestDigest',
|
||||
},
|
||||
controller: function($scope, $element, ApiService) {
|
||||
$scope.labels = null;
|
||||
|
||||
var loadLabels = function() {
|
||||
if (!$scope.repository) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$scope.manifestDigest) {
|
||||
return;
|
||||
}
|
||||
|
||||
$scope.labels = null;
|
||||
$scope.loadError = false;
|
||||
|
||||
var params = {
|
||||
'repository': $scope.repository.namespace + '/' + $scope.repository.name,
|
||||
'manifestref': $scope.manifestDigest
|
||||
};
|
||||
|
||||
ApiService.listManifestLabels(null, params).then(function(resp) {
|
||||
$scope.labels = resp['labels'];
|
||||
}, function() {
|
||||
$scope.loadError = true;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$watch('repository', loadLabels);
|
||||
$scope.$watch('manifestDigest', loadLabels);
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
Reference in a new issue