Merge branch 'master' into redalert
This commit is contained in:
commit
591cd020b8
15 changed files with 153 additions and 184 deletions
|
@ -4478,7 +4478,7 @@ quayApp.directive('dockerfileCommand', function () {
|
|||
},
|
||||
|
||||
'': function(pieces) {
|
||||
var rnamespace = pieces.length == 1 ? '_' : pieces[0];
|
||||
var rnamespace = pieces.length == 1 ? '_' : 'u/' + pieces[0];
|
||||
var rname = pieces[pieces.length - 1].split(':')[0];
|
||||
return 'https://registry.hub.docker.com/' + rnamespace + '/' + rname + '/';
|
||||
}
|
||||
|
@ -4550,7 +4550,7 @@ quayApp.directive('dockerfileView', function () {
|
|||
}
|
||||
|
||||
var lineInfo = {
|
||||
'text': UtilService.textToSafeHtml(line),
|
||||
'text': line,
|
||||
'kind': kind
|
||||
};
|
||||
$scope.lines.push(lineInfo);
|
||||
|
@ -5224,7 +5224,7 @@ quayApp.directive('tagSpecificImagesView', function () {
|
|||
}
|
||||
|
||||
var currentTag = $scope.repository.tags[$scope.tag];
|
||||
if (image.dbid == currentTag.image.dbid) {
|
||||
if (image.dbid == currentTag.dbid) {
|
||||
classes += 'tag-image ';
|
||||
}
|
||||
|
||||
|
@ -5234,8 +5234,6 @@ quayApp.directive('tagSpecificImagesView', function () {
|
|||
var forAllTagImages = function(tag, callback) {
|
||||
if (!tag) { return; }
|
||||
|
||||
callback(tag.image);
|
||||
|
||||
if (!$scope.imageByDBID) {
|
||||
$scope.imageByDBID = [];
|
||||
for (var i = 0; i < $scope.images.length; ++i) {
|
||||
|
@ -5244,7 +5242,14 @@ quayApp.directive('tagSpecificImagesView', function () {
|
|||
}
|
||||
}
|
||||
|
||||
var ancestors = tag.image.ancestors.split('/');
|
||||
var tag_image = $scope.imageByDBID[tag.dbid];
|
||||
if (!tag_image) {
|
||||
return;
|
||||
}
|
||||
|
||||
callback(tag_image);
|
||||
|
||||
var ancestors = tag_image.ancestors.split('/');
|
||||
for (var i = 0; i < ancestors.length; ++i) {
|
||||
var image = $scope.imageByDBID[ancestors[i]];
|
||||
if (image) {
|
||||
|
|
|
@ -450,6 +450,8 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
|||
};
|
||||
|
||||
$scope.loadImageChanges = function(image) {
|
||||
if (!image) { return; }
|
||||
|
||||
var params = {'repository': namespace + '/' + name, 'image_id': image.id};
|
||||
$scope.currentImageChangeResource = ApiService.getImageChangesAsResource(params).get(function(ci) {
|
||||
$scope.currentImageChanges = ci;
|
||||
|
@ -466,31 +468,6 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
|||
addedDisplayed - removedDisplayed - changedDisplayed;
|
||||
};
|
||||
|
||||
$scope.setImage = function(imageId, opt_updateURL) {
|
||||
var image = null;
|
||||
for (var i = 0; i < $scope.images.length; ++i) {
|
||||
var currentImage = $scope.images[i];
|
||||
if (currentImage.id == imageId || currentImage.id.substr(0, 12) == imageId) {
|
||||
image = currentImage;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!image) { return; }
|
||||
|
||||
$scope.currentTag = null;
|
||||
$scope.currentImage = image;
|
||||
$scope.loadImageChanges(image);
|
||||
if ($scope.tree) {
|
||||
$scope.tree.setImage(image.id);
|
||||
}
|
||||
|
||||
if (opt_updateURL) {
|
||||
$location.search('tag', null);
|
||||
$location.search('image', imageId.substr(0, 12));
|
||||
}
|
||||
};
|
||||
|
||||
$scope.showAddTag = function(image) {
|
||||
$scope.toTagImage = image;
|
||||
$('#addTagModal').modal('show');
|
||||
|
@ -513,6 +490,10 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
|||
$('#confirmdeleteTagModal').modal('show');
|
||||
};
|
||||
|
||||
$scope.findImageForTag = function(tag) {
|
||||
return tag && $scope.imageByDBID && $scope.imageByDBID[tag.dbid];
|
||||
};
|
||||
|
||||
$scope.createOrMoveTag = function(image, tagName, opt_invalid) {
|
||||
if (opt_invalid) { return; }
|
||||
|
||||
|
@ -592,13 +573,38 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
|||
return size;
|
||||
};
|
||||
|
||||
$scope.setImage = function(imageId, opt_updateURL) {
|
||||
var image = null;
|
||||
for (var i = 0; i < $scope.images.length; ++i) {
|
||||
var currentImage = $scope.images[i];
|
||||
if (currentImage.id == imageId || currentImage.id.substr(0, 12) == imageId) {
|
||||
image = currentImage;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!image) { return; }
|
||||
|
||||
$scope.currentTag = null;
|
||||
$scope.currentImage = image;
|
||||
$scope.loadImageChanges(image);
|
||||
if ($scope.tree) {
|
||||
$scope.tree.setImage(image.id);
|
||||
}
|
||||
|
||||
if (opt_updateURL) {
|
||||
$location.search('tag', null);
|
||||
$location.search('image', imageId.substr(0, 12));
|
||||
}
|
||||
};
|
||||
|
||||
$scope.setTag = function(tagName, opt_updateURL) {
|
||||
var repo = $scope.repo;
|
||||
if (!repo) { return; }
|
||||
|
||||
var proposedTag = repo.tags[tagName];
|
||||
if (!proposedTag) {
|
||||
// We must find a good default
|
||||
// We must find a good default.
|
||||
for (tagName in repo.tags) {
|
||||
if (!proposedTag || tagName == 'latest') {
|
||||
proposedTag = repo.tags[tagName];
|
||||
|
@ -608,8 +614,8 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
|||
|
||||
if (proposedTag) {
|
||||
$scope.currentTag = proposedTag;
|
||||
$scope.currentImage = proposedTag.image;
|
||||
$scope.loadImageChanges($scope.currentImage);
|
||||
$scope.currentImage = null;
|
||||
|
||||
if ($scope.tree) {
|
||||
$scope.tree.setTag(proposedTag.name);
|
||||
}
|
||||
|
@ -686,9 +692,15 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
|||
var forAllTagImages = function(tag, callback) {
|
||||
if (!tag || !$scope.imageByDBID) { return; }
|
||||
|
||||
callback(tag.image);
|
||||
var tag_image = $scope.imageByDBID[tag.dbid];
|
||||
if (!tag_image) { return; }
|
||||
|
||||
var ancestors = tag.image.ancestors.split('/');
|
||||
// Callback the tag's image itself.
|
||||
callback(tag_image);
|
||||
|
||||
// Callback any parent images.
|
||||
if (!tag_image.ancestors) { return; }
|
||||
var ancestors = tag_image.ancestors.split('/');
|
||||
for (var i = 0; i < ancestors.length; ++i) {
|
||||
var image = $scope.imageByDBID[ancestors[i]];
|
||||
if (image) {
|
||||
|
|
Reference in a new issue