align image labels with tree view, closes #24

This commit is contained in:
Nate Jones 2016-06-10 20:42:45 -07:00
parent f898de1f61
commit 4bd432cec3

View file

@ -418,7 +418,9 @@ func imagesToDot(buffer *bytes.Buffer, images []Image, byParent map[string][]Ima
buffer.WriteString(fmt.Sprintf(" \"%s\" -> \"%s\"\n", truncate(image.ParentId, 12), truncate(image.Id, 12)))
}
if image.RepoTags[0] != "<none>:<none>" {
buffer.WriteString(fmt.Sprintf(" \"%s\" [label=\"%s\\n%s\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n", truncate(image.Id, 12), truncate(image.Id, 12), strings.Join(image.RepoTags, "\\n")))
buffer.WriteString(fmt.Sprintf(" \"%s\" [label=\"%s\\n%s\",shape=box,fillcolor=\"paleturquoise\",style=\"filled,rounded\"];\n", truncate(image.Id, 12), truncate(image.OrigId, 12), strings.Join(image.RepoTags, "\\n")))
} else {
buffer.WriteString(fmt.Sprintf(" \"%s\" [label=\"%s\"]\n", truncate(image.Id, 12), truncate(image.OrigId, 12)))
}
if subimages, exists := byParent[image.Id]; exists {
imagesToDot(buffer, subimages, byParent)