diff --git a/app/components/containersNetwork/containersNetworkController.js b/app/components/containersNetwork/containersNetworkController.js
index 63946139a..8d901e311 100644
--- a/app/components/containersNetwork/containersNetworkController.js
+++ b/app/components/containersNetwork/containersNetworkController.js
@@ -43,12 +43,19 @@ angular.module('containersNetwork', ['ngVis'])
"
ID: " + container.Id + "" +
"Image: " + container.Image + "" +
"",
- 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,