Fix last modified date time handling for tags with no date times, and fix the sort ordering
This commit is contained in:
parent
fe8d006855
commit
699cb9a5da
3 changed files with 13 additions and 5 deletions
|
@ -177,13 +177,17 @@ 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):
|
||||||
return {
|
tag_info = {
|
||||||
'name': tag.name,
|
'name': tag.name,
|
||||||
'image_id': tag.image.docker_image_id,
|
'image_id': tag.image.docker_image_id,
|
||||||
'last_modified': format_date(datetime.datetime.fromtimestamp(tag.lifetime_start_ts)),
|
|
||||||
'size': tag.image.storage.aggregate_size
|
'size': tag.image.storage.aggregate_size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if tag.lifetime_start_ts > 0:
|
||||||
|
tag_info['last_modified'] = format_date(datetime.datetime.fromtimestamp(tag.lifetime_start_ts))
|
||||||
|
|
||||||
|
return tag_info
|
||||||
|
|
||||||
organization = None
|
organization = None
|
||||||
try:
|
try:
|
||||||
organization = model.get_organization(namespace)
|
organization = model.get_organization(namespace)
|
||||||
|
|
|
@ -60,7 +60,10 @@
|
||||||
ng-class="checkedTags.isChecked(tag, checkedTags.checked) ? 'checked' : ''">
|
ng-class="checkedTags.isChecked(tag, checkedTags.checked) ? 'checked' : ''">
|
||||||
<td><span class="cor-checkable-item" controller="checkedTags" item="tag"></span></td>
|
<td><span class="cor-checkable-item" controller="checkedTags" item="tag"></span></td>
|
||||||
<td><i class="fa fa-tag"></i> {{ tag.name }}</td>
|
<td><i class="fa fa-tag"></i> {{ tag.name }}</td>
|
||||||
<td><span am-time-ago="tag.last_modified"></span></td>
|
<td>
|
||||||
|
<span am-time-ago="tag.last_modified" ng-if="tag.last_modified"></span>
|
||||||
|
<span ng-if="!tag.last_modified">Unknown</span>
|
||||||
|
</td>
|
||||||
<td>{{ tag.size | bytes }}</td>
|
<td>{{ tag.size | bytes }}</td>
|
||||||
<td class="image-id-col">
|
<td class="image-id-col">
|
||||||
<a ng-href="/repository/{{ repository.namespace }}/{{ repository.name }}/image/{{ tag.image_id }}">
|
<a ng-href="/repository/{{ repository.namespace }}/{{ repository.name }}/image/{{ tag.image_id }}">
|
||||||
|
|
|
@ -46,9 +46,10 @@ angular.module('quay').directive('repoPanelTags', function () {
|
||||||
for (var tag in $scope.repository.tags) {
|
for (var tag in $scope.repository.tags) {
|
||||||
if (!$scope.repository.tags.hasOwnProperty(tag)) { continue; }
|
if (!$scope.repository.tags.hasOwnProperty(tag)) { continue; }
|
||||||
|
|
||||||
var tagInfo = $.extend($scope.repository.tags[tag], {
|
var tagData = $scope.repository.tags[tag];
|
||||||
|
var tagInfo = $.extend(tagData, {
|
||||||
'name': tag,
|
'name': tag,
|
||||||
'last_modified_datetime': new Date($scope.repository.tags[tag].last_modified)
|
'last_modified_datetime': (new Date(tagData.last_modified || 0)).valueOf() * (-1)
|
||||||
});
|
});
|
||||||
|
|
||||||
allTags.push(tagInfo);
|
allTags.push(tagInfo);
|
||||||
|
|
Reference in a new issue