diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-18 12:56:51 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-18 12:56:51 +1200 |
commit | a90ce59795690267a0924c2b911f14fe0340a6b4 (patch) | |
tree | 5de6442a5a6cc4ed44d7b62cc75f1300a988eb84 /web/app/view | |
parent | afaede42a0cc8170128219bd1dfa6277e4e1809a (diff) | |
parent | 21ed9dbbd8c7be191894b11e895c1c0094b4aac6 (diff) | |
download | trackermap-server-a90ce59795690267a0924c2b911f14fe0340a6b4.tar.gz trackermap-server-a90ce59795690267a0924c2b911f14fe0340a6b4.tar.bz2 trackermap-server-a90ce59795690267a0924c2b911f14fe0340a6b4.zip |
Merge from mungingLabs into odometer
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/main/MainMobile.js | 5 | ||||
-rw-r--r-- | web/app/view/report/Report.js | 9 | ||||
-rw-r--r-- | web/app/view/state/StateController.js | 13 |
3 files changed, 25 insertions, 2 deletions
diff --git a/web/app/view/main/MainMobile.js b/web/app/view/main/MainMobile.js index f32ad9fb1..1cdd6f525 100644 --- a/web/app/view/main/MainMobile.js +++ b/web/app/view/main/MainMobile.js @@ -40,6 +40,11 @@ Ext.define('Traccar.view.main.MainMobile', { xtype: 'deviceView', header: false, flex: 1 + },{ + region: 'east', + xtype: 'stateView', + header: false, + flex: 1 }] }); diff --git a/web/app/view/report/Report.js b/web/app/view/report/Report.js index ff8cc7b3d..5466c7887 100644 --- a/web/app/view/report/Report.js +++ b/web/app/view/report/Report.js @@ -90,7 +90,14 @@ Ext.define('Traccar.view.report.Report', { return speedUnits.convert(value, unit) + ' ' + speedUnits.getUnitName(unit); } }, - { text: strings.positionCourse, dataIndex: 'course', flex: 1 }, + /* { text: strings.positionCourse, dataIndex: 'course', flex: 1 }, */ + { text: 'Odometer', dataIndex: 'odometer', flex: 1, + renderer: function(value) { + var distanceUnits = Ext.getStore('DistanceUnits'); + var unit = Traccar.getApplication().getUser().get('distanceUnit') || Traccar.getApplication().getServer().get('distanceUnit') || ''; + return distanceUnits.convert(value, unit) + ' ' + distanceUnits.getUnitName(unit); + } + }, { text: strings.positionAddress, dataIndex: 'address', flex: 1 } ] diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js index 58b63120b..685805418 100644 --- a/web/app/view/state/StateController.js +++ b/web/app/view/state/StateController.js @@ -59,9 +59,13 @@ Ext.define('Traccar.view.state.StateController', { priority: 6, name: strings.positionSpeed }, - 'course': { +/* 'course': { priority: 7, name: strings.positionCourse + },*/ + 'odometer': { + priority: 7, + name: 'Odometer' }, 'address': { priority: 8, @@ -87,6 +91,13 @@ Ext.define('Traccar.view.state.StateController', { var unit = Traccar.getApplication().getUser().get('speedUnit') || Traccar.getApplication().getServer().get('speedUnit') || ''; value = speedUnits.convert(value, unit) + ' ' + speedUnits.getUnitName(unit); } + + if (key === 'odometer') { + var distanceUnits = Ext.getStore('DistanceUnits'); + var unit = Traccar.getApplication().getUser().get('distanceUnit') || Traccar.getApplication().getServer().get('distanceUnit') || ''; + value = distanceUnits.convert(value, unit) + ' ' + distanceUnits.getUnitName(unit); + } + store.add(Ext.create('Traccar.model.Parameter', { priority: this.keys[key].priority, name: this.keys[key].name, |