aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-12 10:13:45 +0300
committerGitHub <noreply@github.com>2016-08-12 10:13:45 +0300
commit5d3b7cbe5924d4a4552035626a83e26b1e756255 (patch)
tree18c1caaba30f7bb9e6c21cce492d93a85ebc1c73 /web
parent1f11fa7db020f8a46e4b298dc61277460d76b678 (diff)
parent9a55f2b000956717d5caf6fb53793264c0376ce7 (diff)
downloadtrackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.tar.gz
trackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.tar.bz2
trackermap-server-5d3b7cbe5924d4a4552035626a83e26b1e756255.zip
Merge pull request #2206 from Abyss777/ignition
Ignition and Motor Hours
Diffstat (limited to 'web')
-rw-r--r--web/app/AttributeFormatter.js7
-rw-r--r--web/app/model/ReportSummary.js3
-rw-r--r--web/app/view/ReportController.js5
-rw-r--r--web/l10n/en.json6
4 files changed, 20 insertions, 1 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index 3432ca1e0..274b8d028 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -34,6 +34,11 @@ Ext.define('Traccar.AttributeFormatter', {
return Ext.getStore('DistanceUnits').formatValue(value, Traccar.app.getPreference('distanceUnit'));
},
+ hoursFormatter: function (value) {
+ var hours = Math.round(value / 3600000);
+ return (hours + ' ' + Strings.sharedHourAbbreviation);
+ },
+
defaultFormatter: function (value) {
if (typeof value === 'number') {
return Number(value.toFixed(Traccar.Style.numberPrecision));
@@ -58,6 +63,8 @@ Ext.define('Traccar.AttributeFormatter', {
return this.courseFormatter;
} else if (key === 'distance' || key === 'odometer') {
return this.distanceFormatter;
+ } else if (key === 'hours') {
+ return this.hoursFormatter;
} else {
return this.defaultFormatter;
}
diff --git a/web/app/model/ReportSummary.js b/web/app/model/ReportSummary.js
index 7821e1c00..39f0c498c 100644
--- a/web/app/model/ReportSummary.js
+++ b/web/app/model/ReportSummary.js
@@ -33,5 +33,8 @@ Ext.define('Traccar.model.ReportSummary', {
}, {
name: 'distance',
type: 'float'
+ }, {
+ name: 'engineHours',
+ type: 'int'
}]
});
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index ecc7b0f91..61e278993 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -227,6 +227,11 @@ Ext.define('Traccar.view.ReportController', {
dataIndex: 'maxSpeed',
flex: 1,
renderer: Traccar.AttributeFormatter.getFormatter('speed')
+ }, {
+ text: Strings.reportEngineHours,
+ dataIndex: 'engineHours',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('hours')
}];
if (newValue === 'route') {
diff --git a/web/l10n/en.json b/web/l10n/en.json
index b98e6d127..af4f2363e 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -26,6 +26,7 @@
"sharedMute": "Mute",
"sharedType": "Type",
"sharedDistance": "Distance",
+ "sharedHourAbbreviation": "h",
"errorTitle": "Error",
"errorUnknown": "Unknown error",
"errorConnection": "Connection error",
@@ -121,6 +122,8 @@
"eventGeofenceEnter": "Device has entered geofence",
"eventGeofenceExit": "Device has exited geofence",
"eventAlarm": "Alarms",
+ "eventIgnitionOn": "Ignition is ON",
+ "eventIgnitionOff": "Ignition is OFF",
"alarm": "Alarm",
"alarmSos": "SOS Alarm",
"alarmVibration": "Vibration Alarm",
@@ -139,5 +142,6 @@
"reportCsv": "CSV",
"reportDeviceName": "Device Name",
"reportAverageSpeed": "Average Speed",
- "reportMaximumSpeed": "Maximum Speed"
+ "reportMaximumSpeed": "Maximum Speed",
+ "reportEngineHours": "Engine Hours"
} \ No newline at end of file