diff options
author | Abyss777 <abyss@fox5.ru> | 2017-07-12 16:37:06 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-07-12 16:37:06 +0500 |
commit | 805d50ac020dec042bfc94a1f17869372f7eff0e (patch) | |
tree | 23b6796be4ef9cc53ba27f04911b1634762a3dca /web/app/AttributeFormatter.js | |
parent | eea84149b22ed25fa530bbb4159683f802c4dee1 (diff) | |
download | trackermap-web-805d50ac020dec042bfc94a1f17869372f7eff0e.tar.gz trackermap-web-805d50ac020dec042bfc94a1f17869372f7eff0e.tar.bz2 trackermap-web-805d50ac020dec042bfc94a1f17869372f7eff0e.zip |
Implement Driver Unauthorized event and driverName field in Trip report
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r-- | web/app/AttributeFormatter.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index e63cf890..464314ad 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -74,6 +74,18 @@ Ext.define('Traccar.AttributeFormatter', { } }, + driverUniqueIdFormatter: function (value) { + var driver, store; + if (value !== 0) { + store = Ext.getStore('AllDrivers'); + if (store.getTotalCount() === 0) { + store = Ext.getStore('Drivers'); + } + driver = store.findRecord('uniqueId', value, 0, false, true, true); + return driver ? value + ' (' + driver.get('name') + ')' : value; + } + }, + lastUpdateFormatter: function (value) { var seconds, interval; @@ -157,6 +169,8 @@ Ext.define('Traccar.AttributeFormatter', { return this.distanceFormatter; } else if (dataType === 'speed') { return this.speedFormatter; + } else if (dataType === 'driverUniqueId') { + return this.driverUniqueIdFormatter; } else if (dataType === 'voltage') { return this.numberFormatterFactory(Traccar.Style.numberPrecision, Strings.sharedVoltAbbreviation); } else if (dataType === 'percentage') { |