Fixing visuals for the SDN-IP demo.
Change-Id: I6f41e6cd72834ece28212de8b5962abaf2d418e4
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java b/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
index 5353a91..3b233f7 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
@@ -17,6 +17,7 @@
import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
import static org.onlab.onos.cluster.ControllerNodeToNodeId.toNodeId;
+import static org.onlab.onos.net.DefaultAnnotations.merge;
import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED;
import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED;
import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED;
@@ -47,6 +48,7 @@
import org.onlab.onos.cluster.NodeId;
import org.onlab.onos.net.Annotations;
import org.onlab.onos.net.ConnectPoint;
+import org.onlab.onos.net.DefaultAnnotations;
import org.onlab.onos.net.DefaultHost;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.Host;
@@ -237,15 +239,19 @@
return new HostEvent(HOST_MOVED, host);
}
- if (host.ipAddresses().containsAll(descr.ipAddress())) {
+ if (host.ipAddresses().containsAll(descr.ipAddress()) &&
+ descr.annotations().keys().isEmpty()) {
return null;
}
Set<IpAddress> addresses = new HashSet<>(host.ipAddresses());
addresses.addAll(descr.ipAddress());
+ Annotations annotations = merge((DefaultAnnotations) host.annotations(),
+ descr.annotations());
StoredHost updated = new StoredHost(providerId, host.id(),
host.mac(), host.vlan(),
- host.location, addresses);
+ host.location, addresses,
+ annotations);
event = new HostEvent(HOST_UPDATED, updated);
synchronized (this) {
hosts.put(host.id(), updated);
diff --git a/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewMessages.java b/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewMessages.java
index ca0862c..3a64f28 100644
--- a/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewMessages.java
+++ b/web/gui/src/main/java/org/onlab/onos/gui/TopologyViewMessages.java
@@ -241,7 +241,7 @@
.put("id", compactLinkString(link))
.put("type", link.type().toString().toLowerCase())
.put("online", link.state() == Link.State.ACTIVE)
- .put("linkWidth", 2)
+ .put("linkWidth", 1.2)
.put("src", link.src().deviceId().toString())
.put("srcPort", link.src().port().toString())
.put("dst", link.dst().deviceId().toString())
diff --git a/web/gui/src/main/webapp/topo2.css b/web/gui/src/main/webapp/topo2.css
index 20ed2fd..94af382 100644
--- a/web/gui/src/main/webapp/topo2.css
+++ b/web/gui/src/main/webapp/topo2.css
@@ -26,7 +26,7 @@
#topo #map {
stroke-width: 2px;
- stroke: #aaaaaa;
+ stroke: #eee;
fill: transparent;
}
@@ -135,15 +135,15 @@
#topo svg .link.primary {
stroke: #f11;
- stroke-width: 6px;
+ stroke-width: 4px;
}
#topo svg .link.secondary {
stroke: rgba(255,100,100,0.5);
- stroke-width: 4px;
+ stroke-width: 3px;
}
#topo svg .link.animated {
stroke: #f11;
- stroke-width: 10px;
+ stroke-width: 8px;
stroke-dasharray: 8 8
}
diff --git a/web/gui/src/main/webapp/topo2.js b/web/gui/src/main/webapp/topo2.js
index 25782f9..81609e8 100644
--- a/web/gui/src/main/webapp/topo2.js
+++ b/web/gui/src/main/webapp/topo2.js
@@ -854,7 +854,7 @@
var el = d3.select(this),
img;
- $('<img src="img/host.png">').appendTo(el);
+ $('<img src="img/node.png">').appendTo(el);
img = el.select('img')
.attr({
width: 30