aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/app/AttributeFormatter.js4
-rw-r--r--web/app/model/ReportSummary.js4
-rw-r--r--web/app/store/ReportTypes.js3
-rw-r--r--web/app/view/ReportController.js15
-rw-r--r--web/l10n/en.json2
5 files changed, 25 insertions, 3 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js
index c2793827..d207ef1e 100644
--- a/web/app/AttributeFormatter.js
+++ b/web/app/AttributeFormatter.js
@@ -190,6 +190,10 @@ Ext.define('Traccar.AttributeFormatter', {
return value;
},
+ dateFormatter: function (value) {
+ return Ext.Date.format(value, Traccar.Style.dateFormat);
+ },
+
getFormatter: function (key) {
var self = this;
diff --git a/web/app/model/ReportSummary.js b/web/app/model/ReportSummary.js
index dcc0365c..559ffd41 100644
--- a/web/app/model/ReportSummary.js
+++ b/web/app/model/ReportSummary.js
@@ -27,6 +27,10 @@ Ext.define('Traccar.model.ReportSummary', {
name: 'deviceName',
type: 'string'
}, {
+ name: 'startTime',
+ type: 'date',
+ dateFormat: 'c'
+ }, {
name: 'maxSpeed',
type: 'float',
convert: Traccar.AttributeFormatter.getConverter('speed')
diff --git a/web/app/store/ReportTypes.js b/web/app/store/ReportTypes.js
index 48400b88..ceaba9d2 100644
--- a/web/app/store/ReportTypes.js
+++ b/web/app/store/ReportTypes.js
@@ -35,6 +35,9 @@ Ext.define('Traccar.store.ReportTypes', {
key: 'summary',
name: Strings.reportSummary
}, {
+ key: 'daily',
+ name: Strings.reportDaily
+ }, {
key: 'chart',
name: Strings.reportChart
}]
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index 2f10cde1..88a4cea6 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -150,7 +150,7 @@ Ext.define('Traccar.view.ReportController', {
},
onReportClick: function (button) {
- var reportType, from, to, store, url;
+ var reportType, from, to, store, url, daily;
this.getGrid().getSelectionModel().deselectAll();
@@ -164,6 +164,8 @@ Ext.define('Traccar.view.ReportController', {
this.toDate.getFullYear(), this.toDate.getMonth(), this.toDate.getDate(),
this.toTime.getHours(), this.toTime.getMinutes(), this.toTime.getSeconds(), this.toTime.getMilliseconds());
+ daily = reportType === 'daily';
+
this.reportProgress = true;
this.updateButtons();
@@ -186,7 +188,8 @@ Ext.define('Traccar.view.ReportController', {
groupId: this.groupId,
type: this.eventType,
from: from.toISOString(),
- to: to.toISOString()
+ to: to.toISOString(),
+ daily: daily
}
});
} else {
@@ -197,6 +200,7 @@ Ext.define('Traccar.view.ReportController', {
type: this.eventType,
from: Ext.Date.format(from, 'c'),
to: Ext.Date.format(to, 'c'),
+ daily: daily,
mail: button.reference === 'emailButton'
});
}
@@ -427,7 +431,7 @@ Ext.define('Traccar.view.ReportController', {
} else if (newValue === 'events') {
this.getGrid().reconfigure('ReportEvents', this.eventsColumns);
this.getView().getLayout().setActiveItem('grid');
- } else if (newValue === 'summary') {
+ } else if (newValue === 'summary' || newValue === 'daily') {
this.getGrid().reconfigure('ReportSummary', this.summaryColumns);
this.getView().getLayout().setActiveItem('grid');
} else if (newValue === 'trips') {
@@ -538,6 +542,11 @@ Ext.define('Traccar.view.ReportController', {
dataIndex: 'deviceId',
renderer: Traccar.AttributeFormatter.getFormatter('deviceId')
}, {
+ text: Strings.reportStartDate,
+ dataIndex: 'startTime',
+ xtype: 'datecolumn',
+ renderer: Traccar.AttributeFormatter.dateFormatter
+ }, {
text: Strings.sharedDistance,
dataIndex: 'distance',
renderer: Traccar.AttributeFormatter.getFormatter('distance')
diff --git a/web/l10n/en.json b/web/l10n/en.json
index 139640b1..db26de80 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -380,6 +380,7 @@
"reportTrips": "Trips",
"reportStops": "Stops",
"reportSummary": "Summary",
+ "reportDaily": "Daily Summary",
"reportChart": "Chart",
"reportConfigure": "Configure",
"reportEventTypes": "Event Types",
@@ -400,6 +401,7 @@
"reportMaximumSpeed": "Maximum Speed",
"reportEngineHours": "Engine Hours",
"reportDuration": "Duration",
+ "reportStartDate": "Start Date",
"reportStartTime": "Start Time",
"reportStartAddress": "Start Address",
"reportEndTime": "End Time",