Switch to using straight docker IDs instead of a hashing scheme
This commit is contained in:
parent
63628678b8
commit
a90aab4665
8 changed files with 51 additions and 54 deletions
|
@ -307,8 +307,8 @@ ImageHistoryTree.prototype.setHighlightedPath_ = function(image) {
|
|||
this.markPath_(this.currentNode_, false);
|
||||
}
|
||||
|
||||
var imageByInternalId = this.imageByInternalId_;
|
||||
var currentNode = imageByInternalId[image.internal_id];
|
||||
var imageByDockerId = this.imageByDockerId_;
|
||||
var currentNode = imageByDockerId[image.id];
|
||||
if (currentNode) {
|
||||
this.markPath_(currentNode, true);
|
||||
this.currentNode_ = currentNode;
|
||||
|
@ -386,7 +386,7 @@ ImageHistoryTree.prototype.buildRoot_ = function() {
|
|||
var formatted = {"name": "No images found"};
|
||||
|
||||
// Build a node for each image.
|
||||
var imageByInternalId = {};
|
||||
var imageByDockerId = {};
|
||||
for (var i = 0; i < this.images_.length; ++i) {
|
||||
var image = this.images_[i];
|
||||
var imageNode = {
|
||||
|
@ -395,9 +395,9 @@ ImageHistoryTree.prototype.buildRoot_ = function() {
|
|||
"image": image,
|
||||
"tags": image.tags
|
||||
};
|
||||
imageByInternalId[image.internal_id] = imageNode;
|
||||
imageByDockerId[image.id] = imageNode;
|
||||
}
|
||||
this.imageByInternalId_ = imageByInternalId;
|
||||
this.imageByDockerId_ = imageByDockerId;
|
||||
|
||||
// For each node, attach it to its immediate parent. If there is no immediate parent,
|
||||
// then the node is the root.
|
||||
|
@ -408,10 +408,10 @@ ImageHistoryTree.prototype.buildRoot_ = function() {
|
|||
// Skip images that are currently uploading.
|
||||
if (image.uploading) { continue; }
|
||||
|
||||
var imageNode = imageByInternalId[image.internal_id];
|
||||
var imageNode = imageByDockerId[image.id];
|
||||
var ancestors = this.getAncestors_(image);
|
||||
var immediateParent = ancestors[ancestors.length - 1];
|
||||
var parent = imageByInternalId[immediateParent];
|
||||
var parent = imageByDockerId[immediateParent];
|
||||
if (parent) {
|
||||
// Add a reference to the parent. This makes walking the tree later easier.
|
||||
imageNode.parent = parent;
|
||||
|
@ -442,7 +442,7 @@ ImageHistoryTree.prototype.buildRoot_ = function() {
|
|||
// Skip images that are currently uploading.
|
||||
if (image.uploading) { continue; }
|
||||
|
||||
var imageNode = imageByInternalId[image.internal_id];
|
||||
var imageNode = imageByDockerId[image.id];
|
||||
maxChildCount = Math.max(maxChildCount, this.determineMaximumChildCount_(imageNode));
|
||||
}
|
||||
|
||||
|
@ -573,7 +573,7 @@ ImageHistoryTree.prototype.setTag_ = function(tagName) {
|
|||
return;
|
||||
}
|
||||
|
||||
var imageByInternalId = this.imageByInternalId_;
|
||||
var imageByDockerId = this.imageByDockerId_;
|
||||
|
||||
// Save the current tag.
|
||||
var previousTagName = this.currentTag_;
|
||||
|
@ -596,10 +596,10 @@ ImageHistoryTree.prototype.setTag_ = function(tagName) {
|
|||
// Skip images that are currently uploading.
|
||||
if (image.uploading) { continue; }
|
||||
|
||||
var imageNode = this.imageByInternalId_[image.internal_id];
|
||||
var imageNode = this.imageByDockerId_[image.id];
|
||||
var ancestors = this.getAncestors_(image);
|
||||
var immediateParent = ancestors[ancestors.length - 1];
|
||||
var parent = imageByInternalId[immediateParent];
|
||||
var parent = imageByDockerId[immediateParent];
|
||||
if (parent && imageNode.highlighted) {
|
||||
var arr = parent.children;
|
||||
if (parent._children) {
|
||||
|
|
Reference in a new issue