mirror of https://github.com/portainer/portainer
Color and edge cleanup
parent
3db2008c39
commit
758ac41648
|
@ -43,12 +43,19 @@ angular.module('containersNetwork', ['ngVis'])
|
||||||
"<li><strong>ID:</strong> " + container.Id + "</li>" +
|
"<li><strong>ID:</strong> " + container.Id + "</li>" +
|
||||||
"<li><strong>Image:</strong> " + container.Image + "</li>" +
|
"<li><strong>Image:</strong> " + container.Image + "</li>" +
|
||||||
"</ul>",
|
"</ul>",
|
||||||
color: (container.Running ? "cyan" : "gray")
|
color: (container.Running ? "#8888ff" : "#cccccc")
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addLinkEdgeIfExists = function(from, to) {
|
this.hasEdge = function(from, to) {
|
||||||
if (from.Links != null && from.Links[to.Name] != null) {
|
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({
|
this.edges.add({
|
||||||
from: from.Id,
|
from: from.Id,
|
||||||
to: to.Id,
|
to: to.Id,
|
||||||
|
@ -57,7 +64,7 @@ angular.module('containersNetwork', ['ngVis'])
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addVolumeEdgeIfExists = function(from, to) {
|
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({
|
this.edges.add({
|
||||||
from: from.Id,
|
from: from.Id,
|
||||||
to: to.Id,
|
to: to.Id,
|
||||||
|
|
Loading…
Reference in New Issue