diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-13 18:16:13 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-13 18:16:13 +1200 |
commit | 13448f34e263f27610391781d526353791c36026 (patch) | |
tree | 07aae3f2f97c3a1329f94ca69930ad97e77c80f3 /web/app | |
parent | cd86a9e571f64a945e037e054e39d61c59798152 (diff) | |
download | trackermap-server-13448f34e263f27610391781d526353791c36026.tar.gz trackermap-server-13448f34e263f27610391781d526353791c36026.tar.bz2 trackermap-server-13448f34e263f27610391781d526353791c36026.zip |
Add string resources for state
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/Resources.js | 3 | ||||
-rw-r--r-- | web/app/view/map/MapController.js | 6 | ||||
-rw-r--r-- | web/app/view/state/StateController.js | 15 |
3 files changed, 20 insertions, 4 deletions
diff --git a/web/app/Resources.js b/web/app/Resources.js index 03993a2ec..6d0cccd05 100644 --- a/web/app/Resources.js +++ b/web/app/Resources.js @@ -77,7 +77,8 @@ var strings = { state_title: 'State', state_name: 'Parameter', - state_value: 'Value' + state_value: 'Value', + state_protocol: 'Protocol' }; var styles = { diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js index e9757daac..0d5176d09 100644 --- a/web/app/view/map/MapController.js +++ b/web/app/view/map/MapController.js @@ -143,12 +143,16 @@ Ext.define('Traccar.view.map.MapController', { vectorSource.addFeature(this.reportFinish); }, + selectPosition: function(position) { + console.log(position); // DELME + }, + selectDevice: function(device) { console.log(device); // DELME }, selectReport: function(position) { - console.log(position); // DELME + this.selectPosition(position); } }); diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js index 8dd619b72..f85381237 100644 --- a/web/app/view/state/StateController.js +++ b/web/app/view/state/StateController.js @@ -31,6 +31,17 @@ Ext.define('Traccar.view.state.StateController', { init: function() { }, + keys: { + 'fixTime': strings.report_time, + 'latitude': strings.report_latitude, + 'longitude': strings.report_longitude, + 'valid': strings.report_valid, + 'altitude': strings.report_altitude, + 'speed': strings.report_speed, + 'course': strings.report_course, + 'protocol': strings.state_protocol + }, + selectDevice: function(device) { var position = { "fixTime":"2012-01-02T01:50:00", @@ -51,9 +62,9 @@ Ext.define('Traccar.view.state.StateController', { store.removeAll(); for (var key in position) { - if (position.hasOwnProperty(key) && key !== 'other') { + if (position.hasOwnProperty(key) && this.keys[key] !== undefined) { store.add(Ext.create('Traccar.model.Parameter', { - name: key, + name: this.keys[key], value: position[key] })); } |