grim/port-authority

Parents 58b7eaf799e5
Children 773c9f8495d9
show a short id instead of the full id, but show the full image id in the tooltip of the short id
--- a/html/window.html Tue Nov 18 17:21:11 2014 -0600
+++ b/html/window.html Mon Dec 01 15:50:09 2014 -0600
@@ -30,7 +30,7 @@
<span class="badge">{{repo.images.length}}</span>
</li>
<li data-ng-repeat="image in repo.images" class="list-group-item">
- {{image.id}}<span class="badge" data-ng-repeat="tag in repo.tags[image.id]">{{tag}}</span>
+ <span tooltip="{{image.id}}">{{image.short_id}}<span class="badge" data-ng-repeat="tag in repo.tags[image.id]">{{tag}}</span>
</li>
</ul>
</accordion-group>
--- a/js/app.js Tue Nov 18 17:21:11 2014 -0600
+++ b/js/app.js Mon Dec 01 15:50:09 2014 -0600
@@ -13,7 +13,16 @@
return $http.get(registry + "/v1/search");
},
images: function(registry, repo) {
- return $http.get(registry + "/v1/repositories/" + repo + "/images");
+ return $http.get(registry + "/v1/repositories/" + repo + "/images")
+ .success(function(images) {
+ for(var i = 0; i < images.length; i++) {
+ var image = images[i];
+
+ image['short_id'] = image.id.substring(0, 8);
+ }
+
+ return images;
+ });
},
tags: function(registry, repo) {
return $http.get(registry + "/v1/repositories/" + repo + "/tags");