Color and edge cleanup

pull/2/head
Karl Gutwin 2015-08-12 16:37:19 -04:00
parent 3db2008c39
commit 758ac41648
1 changed files with 11 additions and 4 deletions

View File

@ -43,12 +43,19 @@ angular.module('containersNetwork', ['ngVis'])
"<li><strong>ID:</strong> " + container.Id + "</li>" +
"<li><strong>Image:</strong> " + container.Image + "</li>" +
"</ul>",
color: (container.Running ? "cyan" : "gray")
color: (container.Running ? "#8888ff" : "#cccccc")
});
};
this.addLinkEdgeIfExists = function(from, to) {
if (from.Links != null && from.Links[to.Name] != null) {
this.hasEdge = function(from, to) {
return this.edges.getIds({
filter: function (item) {
return item.from == from.Id && item.to == to.Id;
} });
};
this.addLinkEdgeIfExists = function(from, to) {
if (from.Links != null && from.Links[to.Name] != null && !this.hasEdge(from, to)) {
this.edges.add({
from: from.Id,
to: to.Id,
@ -57,7 +64,7 @@ angular.module('containersNetwork', ['ngVis'])
};
this.addVolumeEdgeIfExists = function(from, to) {
if (from.VolumesFrom != null && (from.VolumesFrom[to.Id] != null || from.VolumesFrom[to.Name] != null)) {
if (from.VolumesFrom != null && (from.VolumesFrom[to.Id] != null || from.VolumesFrom[to.Name] != null) && !this.hasEdge(from, to)) {
this.edges.add({
from: from.Id,
to: to.Id,