aboutsummaryrefslogtreecommitdiff
path: root/web/app/AttributeFormatter.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-18 18:33:58 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-18 18:33:58 +0500
commit11826f4b3eac08ad4f52d8c3e6af2b8a0156daee (patch)
treead2e4689aa9d9e652addda75e8f658873b1a3c19 /web/app/AttributeFormatter.js
parenta252dbe43512c75afd4a17075b834f767576fd28 (diff)
downloadetbsa-traccar-web-11826f4b3eac08ad4f52d8c3e6af2b8a0156daee.tar.gz
etbsa-traccar-web-11826f4b3eac08ad4f52d8c3e6af2b8a0156daee.tar.bz2
etbsa-traccar-web-11826f4b3eac08ad4f52d8c3e6af2b8a0156daee.zip
Add Device Name column to Route report
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r--web/app/AttributeFormatter.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index 049532f..a6f6dd9 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -47,6 +47,10 @@ Ext.define('Traccar.AttributeFormatter', {
return (hours + ' ' + Strings.sharedHourAbbreviation + ' ' + minutes + ' ' + Strings.sharedMinuteAbbreviation);
},
+ deviceNameFormatter: function (value) {
+ return Ext.getStore('Devices').findRecord('id', value).get('name');
+ },
+
defaultFormatter: function (value) {
if (typeof value === 'number') {
return Number(value.toFixed(Traccar.Style.numberPrecision));
@@ -78,6 +82,8 @@ Ext.define('Traccar.AttributeFormatter', {
return this.hoursFormatter;
} else if (key === 'duration') {
return this.durationFormatter;
+ } else if (key === 'deviceName') {
+ return this.deviceNameFormatter;
} else {
return this.defaultFormatter;
}