From 401ee249a4c7b0de5eeaf32d1cbee4fd0d82a7a8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 8 Oct 2016 18:53:12 +1300 Subject: Implement statistics report view --- web/app/view/Statistics.js | 78 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 web/app/view/Statistics.js (limited to 'web/app/view/Statistics.js') diff --git a/web/app/view/Statistics.js b/web/app/view/Statistics.js new file mode 100644 index 0000000..7819594 --- /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 + }] +}); -- cgit v1.2.3