1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

refactor(images): relocate tag/digest replacement

This commit is contained in:
Anthony Lapenna 2018-06-21 13:59:50 +03:00
parent 23b0d6f1dc
commit d3a26a4ade
2 changed files with 10 additions and 12 deletions

View file

@ -4,7 +4,17 @@ function ImageViewModel(data) {
this.Repository = data.Repository;
this.Created = data.Created;
this.Checked = false;
this.RepoTags = data.RepoTags;
if (!this.RepoTags && data.RepoDigests) {
this.RepoTags = [];
for (var i = 0; i < data.RepoDigests.length; i++) {
var digest = data.RepoDigests[i];
var repository = digest.substring(0, digest.indexOf('@'));
this.RepoTags.push(repository + ':<none>');
}
}
this.VirtualSize = data.VirtualSize;
this.ContainerCount = data.ContainerCount;