2015-02-20 23:15:48 +00:00
|
|
|
(function() {
|
|
|
|
/**
|
|
|
|
* Page to view the details of a single image.
|
|
|
|
*/
|
|
|
|
angular.module('quayPages').config(['pages', function(pages) {
|
2015-03-20 21:46:02 +00:00
|
|
|
pages.create('image-view', 'image-view.html', ImageViewCtrl, {
|
|
|
|
'newLayout': true,
|
|
|
|
'title': '{{ image.id }}',
|
|
|
|
'description': 'Image {{ image.id }}'
|
2015-06-29 09:33:00 +00:00
|
|
|
})
|
2015-02-20 23:15:48 +00:00
|
|
|
}]);
|
|
|
|
|
2016-02-25 22:42:09 +00:00
|
|
|
function ImageViewCtrl($scope, $routeParams, $rootScope, $timeout, ApiService, ImageMetadataService, Features, CookieService) {
|
2015-03-20 21:46:02 +00:00
|
|
|
var namespace = $routeParams.namespace;
|
|
|
|
var name = $routeParams.name;
|
|
|
|
var imageid = $routeParams.image;
|
|
|
|
|
2016-02-22 23:39:04 +00:00
|
|
|
$scope.imageSecurityCounter = 0;
|
|
|
|
$scope.imagePackageCounter = 0;
|
2016-03-17 18:27:34 +00:00
|
|
|
$scope.newUIExperiment = true; //CookieService.get('quay.exp-new-sec-layout') == 'true';
|
2016-02-25 22:42:09 +00:00
|
|
|
|
2015-11-11 20:52:30 +00:00
|
|
|
$scope.options = {
|
2016-02-22 23:39:04 +00:00
|
|
|
'vulnFilter': ''
|
2015-11-11 20:52:30 +00:00
|
|
|
};
|
|
|
|
|
2015-03-20 21:46:02 +00:00
|
|
|
var loadImage = function() {
|
|
|
|
var params = {
|
|
|
|
'repository': namespace + '/' + name,
|
|
|
|
'image_id': imageid
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.imageResource = ApiService.getImageAsResource(params).get(function(image) {
|
|
|
|
$scope.image = image;
|
|
|
|
$scope.reversedHistory = image.history.reverse();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
var loadRepository = function() {
|
|
|
|
var params = {
|
|
|
|
'repository': namespace + '/' + name
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.repositoryResource = ApiService.getRepoAsResource(params).get(function(repo) {
|
|
|
|
$scope.repository = repo;
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
loadImage();
|
|
|
|
loadRepository();
|
2015-03-23 19:22:22 +00:00
|
|
|
|
2016-02-17 19:50:37 +00:00
|
|
|
$scope.loadImageSecurity = function() {
|
2016-02-22 23:39:04 +00:00
|
|
|
if (!Features.SECURITY_SCANNER) { return; }
|
|
|
|
$scope.imageSecurityCounter++;
|
|
|
|
};
|
2015-11-12 20:42:45 +00:00
|
|
|
|
2016-02-22 23:39:04 +00:00
|
|
|
$scope.loadImagePackages = function() {
|
|
|
|
if (!Features.SECURITY_SCANNER) { return; }
|
|
|
|
$scope.imagePackageCounter++;
|
2015-11-11 20:52:30 +00:00
|
|
|
};
|
|
|
|
|
2015-03-23 19:22:22 +00:00
|
|
|
$scope.initializeTree = function() {
|
2015-03-24 23:28:24 +00:00
|
|
|
if ($scope.tree || !$scope.combinedChanges.length) { return; }
|
2015-03-23 19:22:22 +00:00
|
|
|
|
|
|
|
$scope.tree = new ImageFileChangeTree($scope.image, $scope.combinedChanges);
|
|
|
|
$timeout(function() {
|
|
|
|
$scope.tree.draw('changes-tree-container');
|
|
|
|
}, 100);
|
|
|
|
};
|
2015-03-20 21:46:02 +00:00
|
|
|
}
|
2016-02-17 19:50:37 +00:00
|
|
|
})();
|