diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-08 12:38:57 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-08 12:38:57 +1300 |
commit | d2f8ca9cb1dae87591de1b5e6037c78c15d23d2a (patch) | |
tree | 191c9e7e12ba6a86bc8d9912cc9001e8bc3599e9 /web/app/view | |
parent | 0f6b2460a1d63f135731d22f15ecc33ee90bbef5 (diff) | |
download | trackermap-server-d2f8ca9cb1dae87591de1b5e6037c78c15d23d2a.tar.gz trackermap-server-d2f8ca9cb1dae87591de1b5e6037c78c15d23d2a.tar.bz2 trackermap-server-d2f8ca9cb1dae87591de1b5e6037c78c15d23d2a.zip |
Generate priorities for postion keys
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/Report.js | 2 | ||||
-rw-r--r-- | web/app/view/StateController.js | 50 |
2 files changed, 14 insertions, 38 deletions
diff --git a/web/app/view/Report.js b/web/app/view/Report.js index 6f2359253..65a151c4d 100644 --- a/web/app/view/Report.js +++ b/web/app/view/Report.js @@ -84,7 +84,7 @@ Ext.define('Traccar.view.Report', { flex: 1, renderer: Traccar.AttributeFormatter.getFormatter('valid') }, { - text: Strings.positionTime, + text: Strings.positionFixTime, dataIndex: 'fixTime', flex: 1, xtype: 'datecolumn', diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js index 98adb6b11..e2b80643d 100644 --- a/web/app/view/StateController.js +++ b/web/app/view/StateController.js @@ -35,44 +35,20 @@ Ext.define('Traccar.view.StateController', { } }, - keys: { - fixTime: { - priority: 1, - name: Strings.positionTime - }, - latitude: { - priority: 2, - name: Strings.positionLatitude - }, - longitude: { - priority: 3, - name: Strings.positionLongitude - }, - valid: { - priority: 4, - name: Strings.positionValid - }, - altitude: { - priority: 5, - name: Strings.positionAltitude - }, - speed: { - priority: 6, - name: Strings.positionSpeed - }, - course: { - priority: 7, - name: Strings.positionCourse - }, - address: { - priority: 8, - name: Strings.positionAddress - }, - protocol: { - priority: 9, - name: Strings.positionProtocol + keys: (function () { + var i, list, result; + result = {}; + list = ['fixTime', 'latitude', 'longitude', 'valid', 'altitude', 'speed', 'course', 'address', 'protocol']; + for (i = 0; i < list.length; i++) { + result[list[i]] = { + priority: i, + name: Strings['position' + list[i].replace(/^\w/g, function (s) { + return s.toUpperCase(); + })] + }; } - }, + return result; + }()), formatValue: function (value) { if (typeof (id) === 'number') { |