Fix images repo name

pull/2/head
Michael Crosby 11 years ago
parent a392c8ec87
commit 27a9e97062

@ -68,6 +68,16 @@ angular.module('dockerui.filters', [])
var name = container.Names[0]; var name = container.Names[0];
return name.substring(1, name.length); 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 == '<none>:<none>') { tag = ''; }
return tag;
}
return '';
};
}) })
.filter('getdate', function() { .filter('getdate', function() {
return function(data) { return function(data) {

@ -5,6 +5,7 @@ function ImageViewModel(data) {
this.Repository = data.Repository; this.Repository = data.Repository;
this.Created = data.Created; this.Created = data.Created;
this.Checked = false; this.Checked = false;
this.RepoTags = data.RepoTags;
} }
function ContainerViewModel(data) { function ContainerViewModel(data) {

@ -23,8 +23,8 @@
<tbody> <tbody>
<tr ng-repeat="image in images | orderBy:predicate"> <tr ng-repeat="image in images | orderBy:predicate">
<td><input type="checkbox" ng-model="image.Checked" /></td> <td><input type="checkbox" ng-model="image.Checked" /></td>
<td><a href="/#/images/{{ image.Id }}/?tag={{ image.Repository }}:{{ image.Tag }}">{{ image.Id|truncate:20}}</a></td> <td><a href="/#/images/{{ image.Id }}/?tag={{ image|repotag }}">{{ image.Id|truncate:20}}</a></td>
<td>{{ image.Repository }}:{{ image.Tag }}</td> <td>{{ image|repotag }}</td>
<td>{{ image.Created|getdate }}</td> <td>{{ image.Created|getdate }}</td>
</tr> </tr>
</tbody> </tbody>

Loading…
Cancel
Save