aboutsummaryrefslogtreecommitdiff
path: root/modern/src/admin/StatisticsPage.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/admin/StatisticsPage.js')
-rw-r--r--modern/src/admin/StatisticsPage.js27
1 files changed, 12 insertions, 15 deletions
diff --git a/modern/src/admin/StatisticsPage.js b/modern/src/admin/StatisticsPage.js
index b1504c87..8a6e6013 100644
--- a/modern/src/admin/StatisticsPage.js
+++ b/modern/src/admin/StatisticsPage.js
@@ -1,9 +1,10 @@
-
import React, { useState } from 'react';
-import { FormControl, InputLabel,Select, MenuItem, TextField, Button, TableContainer, Table, TableRow, TableCell, TableHead, TableBody, Paper } from '@material-ui/core';
+import {
+ FormControl, InputLabel, Select, MenuItem, TextField, Button, TableContainer, Table, TableRow, TableCell, TableHead, TableBody, Paper,
+} from '@material-ui/core';
+import moment from 'moment';
import t from '../common/localization';
import { formatDate } from '../common/formatter';
-import moment from 'moment';
import OptionsLayout from '../settings/OptionsLayout';
const Filter = ({ setItems }) => {
@@ -59,10 +60,10 @@ const Filter = ({ setItems }) => {
const query = new URLSearchParams({
from: selectedFrom.toISOString(),
- to: selectedTo.toISOString()
+ to: selectedTo.toISOString(),
});
const response = await fetch(`/api/statistics?${query.toString()}`, {
- Accept: 'application/json'
+ Accept: 'application/json',
});
if (response.ok) {
setItems(await response.json());
@@ -73,7 +74,7 @@ const Filter = ({ setItems }) => {
<>
<FormControl variant="filled" margin="normal" fullWidth>
<InputLabel>{t('reportPeriod')}</InputLabel>
- <Select value={period} onChange={e => setPeriod(e.target.value)}>
+ <Select value={period} onChange={(e) => setPeriod(e.target.value)}>
<MenuItem value="today">{t('reportToday')}</MenuItem>
<MenuItem value="yesterday">{t('reportYesterday')}</MenuItem>
<MenuItem value="thisWeek">{t('reportThisWeek')}</MenuItem>
@@ -90,9 +91,7 @@ const Filter = ({ setItems }) => {
label={t('reportFrom')}
type="datetime-local"
value={from.format(moment.HTML5_FMT.DATETIME_LOCAL)}
- onChange={e =>
- setFrom(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))
- }
+ onChange={(e) => setFrom(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))}
fullWidth
/>
)}
@@ -103,9 +102,7 @@ const Filter = ({ setItems }) => {
label={t('reportTo')}
type="datetime-local"
value={to.format(moment.HTML5_FMT.DATETIME_LOCAL)}
- onChange={e =>
- setTo(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))
- }
+ onChange={(e) => setTo(moment(e.target.value, moment.HTML5_FMT.DATETIME_LOCAL))}
fullWidth
/>
)}
@@ -117,7 +114,7 @@ const Filter = ({ setItems }) => {
>
{t('reportShow')}
</Button>
- </>
+ </>
);
};
@@ -144,7 +141,7 @@ const StatisticsPage = () => {
</TableRow>
</TableHead>
<TableBody>
- {items.map(item => (
+ {items.map((item) => (
<TableRow key={item.id}>
<TableCell>{formatDate(item.captureTime)}</TableCell>
<TableCell>{item.activeUsers}</TableCell>
@@ -155,7 +152,7 @@ const StatisticsPage = () => {
<TableCell>{item.mailSent}</TableCell>
<TableCell>{item.smsSent}</TableCell>
<TableCell>{item.geocoderRequests}</TableCell>
- <TableCell>{item.geolocationRequests}</TableCell>
+ <TableCell>{item.geolocationRequests}</TableCell>
</TableRow>
))}
</TableBody>