From 9d6458439e3a842ff33eefc61258441ff1296975 Mon Sep 17 00:00:00 2001 From: Ashutosh Bishnoi Date: Mon, 22 Feb 2021 10:48:22 +0530 Subject: added missed file --- modern/src/admin/StatisticsPage.js | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 modern/src/admin/StatisticsPage.js diff --git a/modern/src/admin/StatisticsPage.js b/modern/src/admin/StatisticsPage.js new file mode 100644 index 00000000..4aaec3b0 --- /dev/null +++ b/modern/src/admin/StatisticsPage.js @@ -0,0 +1,65 @@ + +import React, { useState } from 'react'; +import { TableContainer, Table, TableRow, TableCell, TableHead, TableBody, Paper } from '@material-ui/core'; +import t from '../common/localization'; +import { formatDate } from '../common/formatter'; +import ReportFilter from '../reports/ReportFilter'; +import ReportLayoutPage from '../reports/ReportLayoutPage'; + +const Filter = ({ setItems }) => { + + const handleSubmit = async (deviceId, from, to, _, headers) => { + const query = new URLSearchParams({ from, to }); + const response = await fetch(`/api/statistics?${query.toString()}`, { headers }); + if (response.ok) { + setItems(await response.json()); + } + } + return ; +} + +const StatisticsPage = () => { + + const [items, setItems] = useState([]); + + return ( + }> + + + + + {t('statisticsCaptureTime')} + {t('statisticsActiveUsers')} + {t('statisticsActiveDevices')} + {t('statisticsRequests')} + {t('statisticsMessagesReceived')} + {t('statisticsMessagesStored')} + {t('notificatorMail')} + {t('notificatorSms')} + {t('statisticsGeocoder')} + {t('statisticsGeolocation')} + + + + {items.map((item) => ( + + {formatDate(item.captureTime)} + {item.activeUsers} + {item.activeDevices} + {item.requests} + {item.messagesReceived} + {item.messagesStored} + {item.mailSent} + {item.smsSent} + {item.geocoderRequests} + {item.geolocationRequests} + + ))} + +
+
+
+ ); +} + +export default StatisticsPage; -- cgit v1.2.3