aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-08-19 10:45:33 +0500
committerAbyss777 <abyss@fox5.ru>2016-08-19 10:45:33 +0500
commit1c7437d6de01fffbe3f69853717808b1790413fd (patch)
treeae6fa7144b30321e754773af4a2d464c9e52c624 /web/app/view
parent3826a93f1009942e22ec80c1e13be71e8e917b01 (diff)
downloadtrackermap-server-1c7437d6de01fffbe3f69853717808b1790413fd.tar.gz
trackermap-server-1c7437d6de01fffbe3f69853717808b1790413fd.tar.bz2
trackermap-server-1c7437d6de01fffbe3f69853717808b1790413fd.zip
- Added trips report
- Refactored reports models - Added tests for ReportUtils - Added speed to test-generator.py - Other changes
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/ReportController.js63
1 files changed, 61 insertions, 2 deletions
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index 61e278993..aeaa1849e 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -1,5 +1,6 @@
/*
* Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2016 Andrey Kunitsyn (abyss@fox5.ru)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -114,7 +115,7 @@ Ext.define('Traccar.view.ReportController', {
window.navigator.msSaveBlob(blob, filename);
} else {
url = window.URL || window.webkitURL;
- downloadUrl = URL.createObjectURL(blob);
+ downloadUrl = url.createObjectURL(blob);
if (filename) {
elementA = document.createElement("a");
elementA.href = downloadUrl;
@@ -131,7 +132,7 @@ Ext.define('Traccar.view.ReportController', {
},
onTypeChange: function (combobox, newValue, oldValue) {
- var routeColumns, eventsColumns, summaryColumns;
+ var routeColumns, eventsColumns, summaryColumns, tripsColumns;
if (oldValue !== null) {
this.onClearClick();
}
@@ -234,12 +235,70 @@ Ext.define('Traccar.view.ReportController', {
renderer: Traccar.AttributeFormatter.getFormatter('hours')
}];
+ tripsColumns = [{
+ text: Strings.reportDeviceName,
+ dataIndex: 'deviceId',
+ flex: 1,
+ renderer: function (value) {
+ return Ext.getStore('Devices').findRecord('id', value).get('name');
+ }
+ }, {
+ text: Strings.reportStartTime,
+ dataIndex: 'startTime',
+ flex: 1,
+ xtype: 'datecolumn',
+ renderer: Traccar.AttributeFormatter.getFormatter('startTime')
+ }, {
+ text: Strings.reportStartAddress,
+ dataIndex: 'startAddress',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('address')
+ }, {
+ text: Strings.reportEndTime,
+ dataIndex: 'endTime',
+ flex: 1,
+ xtype: 'datecolumn',
+ renderer: Traccar.AttributeFormatter.getFormatter('endTime')
+ }, {
+ text: Strings.reportEndAddress,
+ dataIndex: 'endAddress',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('address')
+ }, {
+ text: Strings.sharedDistance,
+ dataIndex: 'distance',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('distance')
+ }, {
+ text: Strings.reportAverageSpeed,
+ dataIndex: 'averageSpeed',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('speed')
+ }, {
+ text: Strings.reportMaximumSpeed,
+ dataIndex: 'maxSpeed',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('speed')
+ }, {
+ text: Strings.reportDuration,
+ dataIndex: 'duration',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('duration')
+ }, {
+ text: Strings.reportSpentFuel,
+ dataIndex: 'spentFuel',
+ flex: 1,
+ renderer: Traccar.AttributeFormatter.getFormatter('spentFuel')
+ }];
+
if (newValue === 'route') {
this.getView().reconfigure('ReportRoute', routeColumns);
} else if (newValue === 'events') {
this.getView().reconfigure('ReportEvents', eventsColumns);
} else if (newValue === 'summary') {
this.getView().reconfigure('ReportSummary', summaryColumns);
+ } else if (newValue === 'trips') {
+ this.getView().reconfigure('ReportTrips', tripsColumns);
}
}