From b2b9e4cb213023697566885340d2ff7b5a44db8b Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 19 Jun 2017 11:34:01 +0500 Subject: - Added columns filters to most windows - Added more columns to UserDevices and UserGroups - Change openlayers version to 4.2.0 --- web/app/AttributeFormatter.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'web/app/AttributeFormatter.js') diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index aecbd8a2..f8bce1b1 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -62,6 +62,18 @@ Ext.define('Traccar.AttributeFormatter', { return Ext.getStore('Devices').getById(value).get('name'); }, + groupIdFormatter: function (value) { + var group; + if (value !== 0) { + if (Ext.getStore('AllGroups').getTotalCount() === 0) { + group = Ext.getStore('Groups').getById(value); + } else { + group = Ext.getStore('AllGroups').getById(value); + } + return group ? group.get('name') : value; + } + }, + lastUpdateFormatter: function (value) { var seconds, interval; @@ -113,6 +125,8 @@ Ext.define('Traccar.AttributeFormatter', { return this.durationFormatter; } else if (key === 'deviceId') { return this.deviceIdFormatter; + } else if (key === 'groupId') { + return this.groupIdFormatter; } else if (key === 'lastUpdate') { return this.lastUpdateFormatter; } else { -- cgit v1.2.3