GUI -- Update to memento format.
Change-Id: I99c579668b17014d4cdceb9ce5898c4ed49c5be4
diff --git a/web/gui/src/main/webapp/json/ev/_capture/rx/addDevice_ex1.json b/web/gui/src/main/webapp/json/ev/_capture/rx/addDevice_ex1.json
index f00cf2c..822fc25 100644
--- a/web/gui/src/main/webapp/json/ev/_capture/rx/addDevice_ex1.json
+++ b/web/gui/src/main/webapp/json/ev/_capture/rx/addDevice_ex1.json
@@ -10,6 +10,13 @@
"",
null
],
- "props": {}
+ "props": {
+ "location": {
+ "type": "latlng",
+ "lat": 123.5,
+ "lng": 67.8
+ },
+ "anotherProp": "foobar"
+ }
}
}
diff --git a/web/gui/src/main/webapp/json/ev/_capture/rx/addDevice_ex2_memo.json b/web/gui/src/main/webapp/json/ev/_capture/rx/addDevice_ex2_memo.json
new file mode 100644
index 0000000..cc8f459
--- /dev/null
+++ b/web/gui/src/main/webapp/json/ev/_capture/rx/addDevice_ex2_memo.json
@@ -0,0 +1,27 @@
+{
+ "event": "addDevice",
+ "payload": {
+ "id": "of:0000000000000003",
+ "type": "switch",
+ "online": true,
+ "labels": [
+ "of:0000000000000003",
+ "3",
+ "",
+ null
+ ],
+ "props": {
+ "location": {
+ "type": "latlng",
+ "lat": 123.5,
+ "lng": 67.8
+ },
+ "anotherProp": "foobar"
+ },
+ "metaUi": {
+ "xpc": 57.3,
+ "ypc": 24.86,
+ "and": "other properties the UI wishes to remember..."
+ }
+ }
+}
diff --git a/web/gui/src/main/webapp/json/ev/_capture/tx/updateMeta_ex1.json b/web/gui/src/main/webapp/json/ev/_capture/tx/updateMeta_ex1.json
index c04727e..6114583 100644
--- a/web/gui/src/main/webapp/json/ev/_capture/tx/updateMeta_ex1.json
+++ b/web/gui/src/main/webapp/json/ev/_capture/tx/updateMeta_ex1.json
@@ -4,7 +4,11 @@
"payload": {
"id": "62:4F:65:BF:FF:B3/-1",
"class": "host",
- "x": 197,
- "y": 177
+ "memento": {
+ "xpc": 57.3,
+ "ypc": 24.86,
+ "and": "other properties the UI wishes to remember..."
+ }
}
}
+
diff --git a/web/gui/src/main/webapp/topo2.js b/web/gui/src/main/webapp/topo2.js
index 701f914..86aca72 100644
--- a/web/gui/src/main/webapp/topo2.js
+++ b/web/gui/src/main/webapp/topo2.js
@@ -1154,16 +1154,18 @@
d.fixed = true;
d3.select(self).classed('fixed', true);
if (config.useLiveData) {
- tellServerCoords(d);
+ sendUpdateMeta(d);
}
}
- function tellServerCoords(d) {
+ function sendUpdateMeta(d) {
sendMessage('updateMeta', {
id: d.id,
'class': d.class,
- x: Math.floor(d.x),
- y: Math.floor(d.y)
+ 'memento': {
+ x: Math.floor(d.x),
+ y: Math.floor(d.y)
+ }
});
}