GUI - Fixed ONOS-300. Unpin now clears memento.
- increased size of device icons to 36 (from 30).
- cleaned up config.icons data, and removed unused code and .png files.
Change-Id: I7f3718db164363b75b395fc1af40493304642949
diff --git a/web/gui/src/main/webapp/img/bgpSpeaker.png b/web/gui/src/main/webapp/img/bgpSpeaker.png
deleted file mode 100644
index 6362381..0000000
--- a/web/gui/src/main/webapp/img/bgpSpeaker.png
+++ /dev/null
Binary files differ
diff --git a/web/gui/src/main/webapp/img/host.png b/web/gui/src/main/webapp/img/host.png
deleted file mode 100644
index 0f4595b..0000000
--- a/web/gui/src/main/webapp/img/host.png
+++ /dev/null
Binary files differ
diff --git a/web/gui/src/main/webapp/img/node.png b/web/gui/src/main/webapp/img/node.png
deleted file mode 100644
index 24b2bb4..0000000
--- a/web/gui/src/main/webapp/img/node.png
+++ /dev/null
Binary files differ
diff --git a/web/gui/src/main/webapp/img/roadm.png b/web/gui/src/main/webapp/img/roadm.png
deleted file mode 100644
index 5129683..0000000
--- a/web/gui/src/main/webapp/img/roadm.png
+++ /dev/null
Binary files differ
diff --git a/web/gui/src/main/webapp/img/router.png b/web/gui/src/main/webapp/img/router.png
deleted file mode 100644
index 8757d56..0000000
--- a/web/gui/src/main/webapp/img/router.png
+++ /dev/null
Binary files differ
diff --git a/web/gui/src/main/webapp/img/switch.png b/web/gui/src/main/webapp/img/switch.png
deleted file mode 100644
index 89bd78a..0000000
--- a/web/gui/src/main/webapp/img/switch.png
+++ /dev/null
Binary files differ
diff --git a/web/gui/src/main/webapp/img/ui.png b/web/gui/src/main/webapp/img/ui.png
deleted file mode 100644
index a3bab6a..0000000
--- a/web/gui/src/main/webapp/img/ui.png
+++ /dev/null
Binary files differ
diff --git a/web/gui/src/main/webapp/json/ev/colors/ev_10_onos.json b/web/gui/src/main/webapp/json/ev/colors/ev_10_onos.json
index 0d02792..b4685cb 100644
--- a/web/gui/src/main/webapp/json/ev/colors/ev_10_onos.json
+++ b/web/gui/src/main/webapp/json/ev/colors/ev_10_onos.json
@@ -6,6 +6,7 @@
"online": true,
"master": "192.168.56.101",
"labels": [
+ "",
"opt-3",
"0000ffffffffff03"
],
diff --git a/web/gui/src/main/webapp/json/ev/colors/ev_11_onos.json b/web/gui/src/main/webapp/json/ev/colors/ev_11_onos.json
index f18aa92..0fde1c0 100644
--- a/web/gui/src/main/webapp/json/ev/colors/ev_11_onos.json
+++ b/web/gui/src/main/webapp/json/ev/colors/ev_11_onos.json
@@ -6,6 +6,7 @@
"online": false,
"master": "onos-2",
"labels": [
+ "",
"sw-9",
"0000ffffffff0009"
],
diff --git a/web/gui/src/main/webapp/json/ev/colors/ev_12_onos.json b/web/gui/src/main/webapp/json/ev/colors/ev_12_onos.json
index 77fe846..4f3af68 100644
--- a/web/gui/src/main/webapp/json/ev/colors/ev_12_onos.json
+++ b/web/gui/src/main/webapp/json/ev/colors/ev_12_onos.json
@@ -6,6 +6,7 @@
"online": false,
"master": "onos-2",
"labels": [
+ "",
"opt-9",
"0000ffffffffff09"
],
diff --git a/web/gui/src/main/webapp/json/ev/colors/ev_6_onos.json b/web/gui/src/main/webapp/json/ev/colors/ev_6_onos.json
index 259f8fa..d19a508 100644
--- a/web/gui/src/main/webapp/json/ev/colors/ev_6_onos.json
+++ b/web/gui/src/main/webapp/json/ev/colors/ev_6_onos.json
@@ -6,6 +6,7 @@
"online": true,
"master": "onos-2",
"labels": [
+ "",
"sw-8",
"0000ffffffff0008"
],
diff --git a/web/gui/src/main/webapp/json/ev/colors/ev_7_onos.json b/web/gui/src/main/webapp/json/ev/colors/ev_7_onos.json
index 6cce0cf..d382b7c 100644
--- a/web/gui/src/main/webapp/json/ev/colors/ev_7_onos.json
+++ b/web/gui/src/main/webapp/json/ev/colors/ev_7_onos.json
@@ -6,6 +6,7 @@
"online": true,
"master": "192.168.56.101",
"labels": [
+ "",
"sw-3",
"0000ffffffff0003"
],
diff --git a/web/gui/src/main/webapp/json/ev/colors/ev_8_onos.json b/web/gui/src/main/webapp/json/ev/colors/ev_8_onos.json
index 898b0f4..c4a9e49 100644
--- a/web/gui/src/main/webapp/json/ev/colors/ev_8_onos.json
+++ b/web/gui/src/main/webapp/json/ev/colors/ev_8_onos.json
@@ -6,6 +6,7 @@
"online": true,
"master": "192.168.56.101",
"labels": [
+ "",
"sw-7",
"0000ffffffff0007"
],
diff --git a/web/gui/src/main/webapp/json/ev/colors/ev_9_onos.json b/web/gui/src/main/webapp/json/ev/colors/ev_9_onos.json
index 4e8b488..ff160d6 100644
--- a/web/gui/src/main/webapp/json/ev/colors/ev_9_onos.json
+++ b/web/gui/src/main/webapp/json/ev/colors/ev_9_onos.json
@@ -6,6 +6,7 @@
"online": true,
"master": "onos-2",
"labels": [
+ "",
"opt-8",
"0000ffffffffff08"
],
diff --git a/web/gui/src/main/webapp/topo2.js b/web/gui/src/main/webapp/topo2.js
index 67311bd..aee4cc0 100644
--- a/web/gui/src/main/webapp/topo2.js
+++ b/web/gui/src/main/webapp/topo2.js
@@ -77,22 +77,21 @@
linkOutWidth: 10
},
icons: {
- w: 30,
- h: 30,
- xoff: -16,
- yoff: -14,
-
device: {
- dim: 30,
- rx: 4
+ dim: 36,
+ rx: 4,
+ xoff: -20,
+ yoff: -18
+ },
+ host: {
+ defaultRadius: 9,
+ radius: {
+ endstation: 14,
+ bgpSpeaker: 14,
+ router: 14
+ }
}
},
- iconUrl: {
- device: 'img/device.png',
- host: 'img/host.png',
- pkt: 'img/pkt.png',
- opt: 'img/opt.png'
- },
force: {
note_for_links: 'link.type is used to differentiate',
linkDistance: {
@@ -335,6 +334,7 @@
function unpin() {
if (hovered) {
+ sendUpdateMeta(hovered);
hovered.fixed = false;
hovered.el.classed('fixed', false);
network.force.resume();
@@ -684,7 +684,7 @@
if (d) {
$.extend(d, device);
if (positionNode(d, true)) {
- sendUpdateMeta(d);
+ sendUpdateMeta(d, true);
}
updateNodes();
} else {
@@ -1596,7 +1596,8 @@
node = d.el,
box,
dx,
- dy;
+ dy,
+ cfg = config.icons.device;
node.select('text')
.text(label)
@@ -1606,12 +1607,12 @@
if (noLabel) {
box = emptyBox();
- dx = -config.icons.device.dim/2;
- dy = -config.icons.device.dim/2;
+ dx = -cfg.dim/2;
+ dy = -cfg.dim/2;
} else {
box = adjustRectToFitText(node);
- dx = box.x + config.icons.xoff;
- dy = box.y + config.icons.yoff;
+ dx = box.x + cfg.xoff;
+ dy = box.y + cfg.yoff;
}
node.select('rect')
@@ -1709,18 +1710,12 @@
addDeviceIcon(node, box, noLabel, iconGlyphUrl(d));
});
- // TODO: better place for this configuration state
- var defaultHostRadius = 9,
- hostRadius = {
- bgpSpeaker: 14,
- router: 14,
- endstation: 14
- };
// augment host nodes...
entering.filter('.host').each(function (d) {
var node = d3.select(this),
- r = hostRadius[d.type] || defaultHostRadius,
+ cfg = config.icons.host,
+ r = cfg.radius[d.type] || cfg.defaultRadius,
textDy = r + 10,
iid = iconGlyphUrl(d);
@@ -1790,8 +1785,8 @@
dy = -cfg.dim/2;
} else {
box = adjustRectToFitText(node);
- dx = box.x + config.icons.xoff;
- dy = box.y + config.icons.yoff;
+ dx = box.x + cfg.xoff;
+ dy = box.y + cfg.yoff;
}
g = node.append('g')
@@ -2314,14 +2309,19 @@
gly.defBadges(defs);
}
- function sendUpdateMeta(d) {
- var ll = geoMapProjection.invert([d.x, d.y]),
+ function sendUpdateMeta(d, store) {
+ var metaUi = {},
+ ll;
+
+ if (store) {
+ ll = geoMapProjection.invert([d.x, d.y]);
metaUi = {
x: d.x,
y: d.y,
lng: ll[0],
lat: ll[1]
};
+ }
d.metaUi = metaUi;
sendMessage('updateMeta', {
id: d.id,
@@ -2388,7 +2388,7 @@
d.fixed = true;
d3.select(self).classed('fixed', true);
if (config.useLiveData) {
- sendUpdateMeta(d);
+ sendUpdateMeta(d, true);
} else {
console.log('Moving node ' + d.id + ' to [' + d.x + ',' + d.y + ']');
}