Merge branch 'master' of ssh://bitbucket.org/yackob03/quay
This commit is contained in:
commit
4726b9d6b2
4 changed files with 53 additions and 55 deletions
|
@ -138,21 +138,6 @@ class RepositoryList(ApiResource):
|
||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def image_view(image):
|
|
||||||
extended_props = image
|
|
||||||
if image.storage and image.storage.id:
|
|
||||||
extended_props = image.storage
|
|
||||||
|
|
||||||
command = extended_props.command
|
|
||||||
return {
|
|
||||||
'id': image.docker_image_id,
|
|
||||||
'created': format_date(extended_props.created),
|
|
||||||
'comment': extended_props.comment,
|
|
||||||
'command': json.loads(command) if command else None,
|
|
||||||
'ancestors': image.ancestors,
|
|
||||||
'dbid': image.id,
|
|
||||||
'size': extended_props.image_size
|
|
||||||
}
|
|
||||||
|
|
||||||
@resource('/v1/repository/<repopath:repository>')
|
@resource('/v1/repository/<repopath:repository>')
|
||||||
class Repository(RepositoryParamResource):
|
class Repository(RepositoryParamResource):
|
||||||
|
@ -181,13 +166,10 @@ class Repository(RepositoryParamResource):
|
||||||
logger.debug('Get repo: %s/%s' % (namespace, repository))
|
logger.debug('Get repo: %s/%s' % (namespace, repository))
|
||||||
|
|
||||||
def tag_view(tag):
|
def tag_view(tag):
|
||||||
image = model.get_tag_image(namespace, repository, tag.name)
|
|
||||||
if not image:
|
|
||||||
return {}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'name': tag.name,
|
'name': tag.name,
|
||||||
'image': image_view(image),
|
'image_id': tag.image.docker_image_id,
|
||||||
|
'dbid': tag.image.id
|
||||||
}
|
}
|
||||||
|
|
||||||
organization = None
|
organization = None
|
||||||
|
|
|
@ -4271,7 +4271,7 @@ quayApp.directive('dockerfileCommand', function () {
|
||||||
},
|
},
|
||||||
|
|
||||||
'': function(pieces) {
|
'': 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];
|
var rname = pieces[pieces.length - 1].split(':')[0];
|
||||||
return 'https://registry.hub.docker.com/' + rnamespace + '/' + rname + '/';
|
return 'https://registry.hub.docker.com/' + rnamespace + '/' + rname + '/';
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,31 +466,6 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
||||||
addedDisplayed - removedDisplayed - changedDisplayed;
|
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.showAddTag = function(image) {
|
||||||
$scope.toTagImage = image;
|
$scope.toTagImage = image;
|
||||||
$('#addTagModal').modal('show');
|
$('#addTagModal').modal('show');
|
||||||
|
@ -513,6 +488,10 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
||||||
$('#confirmdeleteTagModal').modal('show');
|
$('#confirmdeleteTagModal').modal('show');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.findImageForTag = function(tag) {
|
||||||
|
return tag && $scope.imageByDBID && $scope.imageByDBID[tag.dbid];
|
||||||
|
};
|
||||||
|
|
||||||
$scope.createOrMoveTag = function(image, tagName, opt_invalid) {
|
$scope.createOrMoveTag = function(image, tagName, opt_invalid) {
|
||||||
if (opt_invalid) { return; }
|
if (opt_invalid) { return; }
|
||||||
|
|
||||||
|
@ -592,13 +571,38 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
||||||
return size;
|
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) {
|
$scope.setTag = function(tagName, opt_updateURL) {
|
||||||
var repo = $scope.repo;
|
var repo = $scope.repo;
|
||||||
if (!repo) { return; }
|
if (!repo) { return; }
|
||||||
|
|
||||||
var proposedTag = repo.tags[tagName];
|
var proposedTag = repo.tags[tagName];
|
||||||
if (!proposedTag) {
|
if (!proposedTag) {
|
||||||
// We must find a good default
|
// We must find a good default.
|
||||||
for (tagName in repo.tags) {
|
for (tagName in repo.tags) {
|
||||||
if (!proposedTag || tagName == 'latest') {
|
if (!proposedTag || tagName == 'latest') {
|
||||||
proposedTag = repo.tags[tagName];
|
proposedTag = repo.tags[tagName];
|
||||||
|
@ -608,8 +612,8 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
||||||
|
|
||||||
if (proposedTag) {
|
if (proposedTag) {
|
||||||
$scope.currentTag = proposedTag;
|
$scope.currentTag = proposedTag;
|
||||||
$scope.currentImage = proposedTag.image;
|
$scope.currentImage = null;
|
||||||
$scope.loadImageChanges($scope.currentImage);
|
|
||||||
if ($scope.tree) {
|
if ($scope.tree) {
|
||||||
$scope.tree.setTag(proposedTag.name);
|
$scope.tree.setTag(proposedTag.name);
|
||||||
}
|
}
|
||||||
|
@ -686,9 +690,14 @@ function RepoCtrl($scope, $sanitize, Restangular, ImageMetadataService, ApiServi
|
||||||
var forAllTagImages = function(tag, callback) {
|
var forAllTagImages = function(tag, callback) {
|
||||||
if (!tag || !$scope.imageByDBID) { return; }
|
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.
|
||||||
|
var ancestors = tag_image.ancestors.split('/');
|
||||||
for (var i = 0; i < ancestors.length; ++i) {
|
for (var i = 0; i < ancestors.length; ++i) {
|
||||||
var image = $scope.imageByDBID[ancestors[i]];
|
var image = $scope.imageByDBID[ancestors[i]];
|
||||||
if (image) {
|
if (image) {
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
content-changed="updateForDescription" field-title="'repository description'"></div>
|
content-changed="updateForDescription" field-title="'repository description'"></div>
|
||||||
|
|
||||||
<!-- Empty message -->
|
<!-- Empty message -->
|
||||||
<div class="repo-content" ng-show="!currentTag.image && !currentImage && !repo.is_building">
|
<div class="repo-content" ng-show="!currentTag.image_id && !currentImage && !repo.is_building">
|
||||||
<div class="empty-message">
|
<div class="empty-message">
|
||||||
This repository is empty
|
This repository is empty
|
||||||
</div>
|
</div>
|
||||||
|
@ -100,14 +100,14 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="repo-content" ng-show="!currentTag.image && repo.is_building">
|
<div class="repo-content" ng-show="!currentTag.image_id && repo.is_building">
|
||||||
<div class="empty-message">
|
<div class="empty-message">
|
||||||
A build is currently processing. If this takes longer than an hour, please <a href="/contact">contact us</a>
|
A build is currently processing. If this takes longer than an hour, please <a href="/contact">contact us</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Content view -->
|
<!-- Content view -->
|
||||||
<div class="repo-content" ng-show="currentTag.image || currentImage">
|
<div class="repo-content" ng-show="currentTag.image_id || currentImage">
|
||||||
<!-- Image History -->
|
<!-- Image History -->
|
||||||
<div id="image-history" style="max-height: 10px;">
|
<div id="image-history" style="max-height: 10px;">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -163,7 +163,14 @@
|
||||||
<div id="current-tag" ng-show="currentTag">
|
<div id="current-tag" ng-show="currentTag">
|
||||||
<dl class="dl-normal">
|
<dl class="dl-normal">
|
||||||
<dt>Last Modified</dt>
|
<dt>Last Modified</dt>
|
||||||
<dd am-time-ago="parseDate(currentTag.image.created)"></dd>
|
<dd ng-if="!findImageForTag(currentTag, images)">
|
||||||
|
<span class="quay-spinner"></span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dd am-time-ago="parseDate(findImageForTag(currentTag, images).created)"
|
||||||
|
ng-if="findImageForTag(currentTag, images)">
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt>Total Compressed Size</dt>
|
<dt>Total Compressed Size</dt>
|
||||||
<dd><span class="context-tooltip"
|
<dd><span class="context-tooltip"
|
||||||
data-title="The amount of data sent between Docker and Quay.io when pushing/pulling"
|
data-title="The amount of data sent between Docker and Quay.io when pushing/pulling"
|
||||||
|
|
Reference in a new issue