aboutsummaryrefslogtreecommitdiff
path: root/web/app/AttributeFormatter.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-12 16:37:06 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-12 16:37:06 +0500
commit805d50ac020dec042bfc94a1f17869372f7eff0e (patch)
tree23b6796be4ef9cc53ba27f04911b1634762a3dca /web/app/AttributeFormatter.js
parenteea84149b22ed25fa530bbb4159683f802c4dee1 (diff)
downloadetbsa-traccar-web-805d50ac020dec042bfc94a1f17869372f7eff0e.tar.gz
etbsa-traccar-web-805d50ac020dec042bfc94a1f17869372f7eff0e.tar.bz2
etbsa-traccar-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.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index e63cf89..464314a 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') {