From 11826f4b3eac08ad4f52d8c3e6af2b8a0156daee Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 18 Nov 2016 18:33:58 +0500 Subject: Add Device Name column to Route report --- web/app/AttributeFormatter.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/app/AttributeFormatter.js') diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index 049532f2..a6f6dd91 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; } -- cgit v1.2.3