aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-15 22:55:09 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-15 22:55:09 +1200
commit946978e44223beb5b4b202c80dce6319f9a5cc14 (patch)
treef7f006121e3f4186dd0fbb3b9e8695cbd5826cf2 /web/app
parentfd8ac5fd906b398f86ecd04820fedb86b8e39a9a (diff)
downloadtraccar-server-946978e44223beb5b4b202c80dce6319f9a5cc14.tar.gz
traccar-server-946978e44223beb5b4b202c80dce6319f9a5cc14.tar.bz2
traccar-server-946978e44223beb5b4b202c80dce6319f9a5cc14.zip
Store extra data in JSON format
Diffstat (limited to 'web/app')
-rw-r--r--web/app/model/Position.js2
-rw-r--r--web/app/view/state/StateController.js7
2 files changed, 7 insertions, 2 deletions
diff --git a/web/app/model/Position.js b/web/app/model/Position.js
index f80bece32..c2b83bb87 100644
--- a/web/app/model/Position.js
+++ b/web/app/model/Position.js
@@ -32,6 +32,6 @@ Ext.define('Traccar.model.Position', {
{ name: 'speed', type: 'float' },
{ name: 'course', type: 'float' },
{ name: 'address', type: 'string' },
- { name: 'other', type: 'string' }
+ { name: 'other' }
]
});
diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js
index b3a8e8eed..1e2c271d1 100644
--- a/web/app/view/state/StateController.js
+++ b/web/app/view/state/StateController.js
@@ -75,6 +75,7 @@ Ext.define('Traccar.view.state.StateController', {
updatePosition: function(position) {
+ var other;
var store = Ext.getStore('Parameters');
store.removeAll();
@@ -89,7 +90,11 @@ Ext.define('Traccar.view.state.StateController', {
}
var xml = position.get('other');
- var other = this.parseXml(xml);
+ if (typeof xml === 'string' || xml instanceof String) {
+ other = this.parseXml(xml);
+ } else {
+ other = xml;
+ }
for (var key in other) {
if (other.hasOwnProperty(key)) {
store.add(Ext.create('Traccar.model.Parameter', {