aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-05-31 15:01:23 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-05-31 15:01:23 +1200
commitb584b73e523729f28cd294fa1c54a1198ddcea30 (patch)
treeb7f982bc02de9bb10d94b2de76c49a8620c5d7ce /web
parent4176894097bb9f3d06ff339e9e845c4969ca6874 (diff)
downloadtrackermap-server-b584b73e523729f28cd294fa1c54a1198ddcea30.tar.gz
trackermap-server-b584b73e523729f28cd294fa1c54a1198ddcea30.tar.bz2
trackermap-server-b584b73e523729f28cd294fa1c54a1198ddcea30.zip
Request report only if device selected
Diffstat (limited to 'web')
-rw-r--r--web/app/view/ReportController.js34
1 files changed, 18 insertions, 16 deletions
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js
index 9c2abcc71..4fe7c62b8 100644
--- a/web/app/view/ReportController.js
+++ b/web/app/view/ReportController.js
@@ -37,25 +37,27 @@ Ext.define('Traccar.view.ReportController', {
fromDate = this.lookupReference('fromDateField').getValue();
fromTime = this.lookupReference('fromTimeField').getValue();
- from = new Date(
- fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate(),
- fromTime.getHours(), fromTime.getMinutes(), fromTime.getSeconds(), fromTime.getMilliseconds());
+ if (deviceId) {
+ from = new Date(
+ fromDate.getFullYear(), fromDate.getMonth(), fromDate.getDate(),
+ fromTime.getHours(), fromTime.getMinutes(), fromTime.getSeconds(), fromTime.getMilliseconds());
- toDate = this.lookupReference('toDateField').getValue();
- toTime = this.lookupReference('toTimeField').getValue();
+ toDate = this.lookupReference('toDateField').getValue();
+ toTime = this.lookupReference('toTimeField').getValue();
- to = new Date(
- toDate.getFullYear(), toDate.getMonth(), toDate.getDate(),
- toTime.getHours(), toTime.getMinutes(), toTime.getSeconds(), toTime.getMilliseconds());
+ to = new Date(
+ toDate.getFullYear(), toDate.getMonth(), toDate.getDate(),
+ toTime.getHours(), toTime.getMinutes(), toTime.getSeconds(), toTime.getMilliseconds());
- store = Ext.getStore('Positions');
- store.load({
- params: {
- deviceId: deviceId,
- from: from.toISOString(),
- to: to.toISOString()
- }
- });
+ store = Ext.getStore('Positions');
+ store.load({
+ params: {
+ deviceId: deviceId,
+ from: from.toISOString(),
+ to: to.toISOString()
+ }
+ });
+ }
},
onClearClick: function () {