aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/map/MapController.js6
-rw-r--r--web/app/view/state/StateController.js15
2 files changed, 18 insertions, 3 deletions
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]
}));
}