diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-10-08 18:53:12 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-10-08 18:53:12 +1300 |
commit | 401ee249a4c7b0de5eeaf32d1cbee4fd0d82a7a8 (patch) | |
tree | fcc70bbaa11e4e0b683134496007bdafc1110598 /web/app/view/Statistics.js | |
parent | 4966403aab46912dd29b8385b6050e95c47c295f (diff) | |
download | trackermap-web-401ee249a4c7b0de5eeaf32d1cbee4fd0d82a7a8.tar.gz trackermap-web-401ee249a4c7b0de5eeaf32d1cbee4fd0d82a7a8.tar.bz2 trackermap-web-401ee249a4c7b0de5eeaf32d1cbee4fd0d82a7a8.zip |
Implement statistics report view
Diffstat (limited to 'web/app/view/Statistics.js')
-rw-r--r-- | web/app/view/Statistics.js | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/web/app/view/Statistics.js b/web/app/view/Statistics.js new file mode 100644 index 00000000..78195949 --- /dev/null +++ b/web/app/view/Statistics.js @@ -0,0 +1,78 @@ +/* + * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +Ext.define('Traccar.view.Statistics', { + extend: 'Ext.grid.Panel', + xtype: 'statisticsView', + + requires: [ + 'Traccar.view.StatisticsController' + ], + + controller: 'statistics', + store: 'Statistics', + + tbar: [{ + xtype: 'tbtext', + html: Strings.reportFrom + }, { + xtype: 'datefield', + reference: 'fromDateField', + startDay: Traccar.Style.weekStartDay, + format: Traccar.Style.dateFormat, + value: new Date(new Date().getTime() - 24 * 60 * 60 * 1000) + }, '-', { + xtype: 'tbtext', + html: Strings.reportTo + }, { + xtype: 'datefield', + reference: 'toDateField', + startDay: Traccar.Style.weekStartDay, + format: Traccar.Style.dateFormat, + value: new Date() + }, '-', { + text: Strings.reportShow, + handler: 'onShowClick' + }], + + columns: [{ + text: Strings.statisticsCaptureTime, + dataIndex: 'captureTime', + flex: 1, + xtype: 'datecolumn', + renderer: Traccar.AttributeFormatter.defaultFormatter() + }, { + text: Strings.statisticsActiveUsers, + dataIndex: 'activeUsers', + flex: 1 + }, { + text: Strings.statisticsActiveDevices, + dataIndex: 'activeDevices', + flex: 1 + }, { + text: Strings.statisticsRequests, + dataIndex: 'requests', + flex: 1 + }, { + text: Strings.statisticsMessagesReceived, + dataIndex: 'messagesReceived', + flex: 1 + }, { + text: Strings.statisticsMessagesStored, + dataIndex: 'messagesStored', + flex: 1 + }] +}); |