Start on new tag view
This commit is contained in:
parent
581a284744
commit
afc8e95e19
103 changed files with 148505 additions and 458 deletions
|
@ -1,5 +1,6 @@
|
|||
import logging
|
||||
import json
|
||||
import datetime
|
||||
|
||||
from flask import request
|
||||
|
||||
|
@ -177,7 +178,9 @@ class Repository(RepositoryParamResource):
|
|||
def tag_view(tag):
|
||||
return {
|
||||
'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
|
||||
}
|
||||
|
||||
organization = None
|
||||
|
@ -196,6 +199,9 @@ class Repository(RepositoryParamResource):
|
|||
active_builds = model.list_repository_builds(namespace, repository, 1,
|
||||
include_inactive=False)
|
||||
|
||||
is_starred = (model.repository_is_starred(get_authenticated_user(), repo)
|
||||
if get_authenticated_user() else False)
|
||||
|
||||
return {
|
||||
'namespace': namespace,
|
||||
'name': repository,
|
||||
|
@ -206,6 +212,7 @@ class Repository(RepositoryParamResource):
|
|||
'is_public': is_public,
|
||||
'is_building': len(list(active_builds)) > 0,
|
||||
'is_organization': bool(organization),
|
||||
'is_starred': is_starred,
|
||||
'status_token': repo.badge_token if not is_public else ''
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue