GUI Topo -- Cleaned up NodeBadge, now that we have a clearer idea of what we want to model.
Change-Id: I754a94cbd1fbe2a2c8affccaca88c48c3fa33b92
diff --git a/web/gui/src/main/webapp/app/view/topo/topoD3.js b/web/gui/src/main/webapp/app/view/topo/topoD3.js
index d29748b..1f061dd 100644
--- a/web/gui/src/main/webapp/app/view/topo/topoD3.js
+++ b/web/gui/src/main/webapp/app/view/topo/topoD3.js
@@ -218,6 +218,24 @@
.attr('transform', sus.translate(dx, dy));
}
+ function updateDeviceBadge(d) {
+ // TODO: Fix this WIP
+ var node = d.el,
+ bsel;
+
+ if (d.badge) {
+ bsel = node.append('g')
+ .classed('badge', true)
+ .attr('transform', sus.translate(-14, -14));
+
+ bsel.append('circle')
+ .attr('r', 14);
+ bsel.append('text')
+ .attr('transform', sus.translate(-5, 3))
+ .text('42');
+ }
+ }
+
function updateHostLabel(d) {
var label = trimLabel(hostLabel(d));
d.el.select('text').text(label);
@@ -241,6 +259,7 @@
var node = d.el;
node.classed('online', d.online);
updateDeviceLabel(d);
+ updateDeviceBadge(d);
api.posNode(d, true);
}