aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-12 18:47:39 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-12 18:47:39 +1200
commit4ddc9fbd11395760dc69c04cb806ba173676f56c (patch)
tree422828cd52f771faa9c7ab6c7cb3a9fa7bf832d3
parentff1b03e46767d92432827f3bad8e6b0e124dd33a (diff)
downloadtraccar-server-4ddc9fbd11395760dc69c04cb806ba173676f56c.tar.gz
traccar-server-4ddc9fbd11395760dc69c04cb806ba173676f56c.tar.bz2
traccar-server-4ddc9fbd11395760dc69c04cb806ba173676f56c.zip
Populate state with dummy data
-rw-r--r--web/app/view/state/State.js2
-rw-r--r--web/app/view/state/StateController.js38
2 files changed, 39 insertions, 1 deletions
diff --git a/web/app/view/state/State.js b/web/app/view/state/State.js
index de7cab87f..595d845a2 100644
--- a/web/app/view/state/State.js
+++ b/web/app/view/state/State.js
@@ -23,7 +23,7 @@ Ext.define('Traccar.view.state.State', {
],
controller: 'state',
- //store: 'Parameters',
+ store: 'Parameters',
title: strings.state_title,
diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js
index 8050bcb88..be9e1a15b 100644
--- a/web/app/view/state/StateController.js
+++ b/web/app/view/state/StateController.js
@@ -18,7 +18,45 @@ Ext.define('Traccar.view.state.StateController', {
extend: 'Ext.app.ViewController',
alias: 'controller.state',
+ config: {
+ listen: {
+ controller: {
+ '*': {
+ selectDevice: 'selectDevice'
+ }
+ }
+ }
+ },
+
init: function() {
+ },
+
+ selectDevice: function(device) {
+ var position = {
+ "fixTime":"2012-01-02T01:50:00",
+ "longitude":130.0,
+ "latitude":60.0,
+ "valid":true,
+ "altitude":0.0,
+ "speed":0.0,
+ "course":0.0,
+ "deviceId":1,
+ "other":"<info><status>84-20</status></info>",
+ "deviceTime":"2012-01-02T01:50:00",
+ "id":29,
+ "protocol":"gotop"
+ };
+
+ var store = Ext.getStore('Parameters');
+
+ for (var key in position) {
+ if (position.hasOwnProperty(key) && key !== 'other') {
+ store.add(Ext.create('Traccar.model.Parameter', {
+ name: key,
+ value: position[key]
+ }));
+ }
+ }
}
});