From 27a9e97062808b0ad9f4f3b8fcf5bc3954c9b59b Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Fri, 13 Dec 2013 10:26:58 -0800 Subject: [PATCH] Fix images repo name --- js/filters.js | 10 ++++++++++ js/viewmodel.js | 1 + partials/images.html | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/js/filters.js b/js/filters.js index 4be249519..c9c39c6f3 100644 --- a/js/filters.js +++ b/js/filters.js @@ -68,6 +68,16 @@ angular.module('dockerui.filters', []) var name = container.Names[0]; return name.substring(1, name.length); }; + }) + .filter('repotag', function() { + return function(image) { + if (image.RepoTags && image.RepoTags.length > 0) { + var tag = image.RepoTags[0]; + if (tag == ':') { tag = ''; } + return tag; + } + return ''; + }; }) .filter('getdate', function() { return function(data) { diff --git a/js/viewmodel.js b/js/viewmodel.js index f8578a879..7a17b21e9 100644 --- a/js/viewmodel.js +++ b/js/viewmodel.js @@ -5,6 +5,7 @@ function ImageViewModel(data) { this.Repository = data.Repository; this.Created = data.Created; this.Checked = false; + this.RepoTags = data.RepoTags; } function ContainerViewModel(data) { diff --git a/partials/images.html b/partials/images.html index 7751b5d07..e93a6fa3a 100644 --- a/partials/images.html +++ b/partials/images.html @@ -23,8 +23,8 @@ - {{ image.Id|truncate:20}} - {{ image.Repository }}:{{ image.Tag }} + {{ image.Id|truncate:20}} + {{ image|repotag }} {{ image.Created|getdate }}