Thomas Vachuska
Committed by Gerrit Code Review

Fixing visuals for the SDN-IP demo.

Change-Id: I6f41e6cd72834ece28212de8b5962abaf2d418e4
......@@ -17,6 +17,7 @@ package org.onlab.onos.store.host.impl;
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.ControllerNode;
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 @@ public class GossipHostStore
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);
......
......@@ -241,7 +241,7 @@ public abstract class TopologyViewMessages {
.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())
......
......@@ -26,7 +26,7 @@
#topo #map {
stroke-width: 2px;
stroke: #aaaaaa;
stroke: #eee;
fill: transparent;
}
......@@ -135,15 +135,15 @@ svg .node.host circle {
#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
}
......
......@@ -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
......