blob: 3a72f81be3bc2f3f65ff63539d0ec33e57c8cc4d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import {
Table, TableRow, TableCell, TableHead, TableBody,
} from '@mui/material';
import { useTranslation } from '../common/components/LocalizationProvider';
import PageLayout from '../common/components/PageLayout';
import ReportsMenu from './components/ReportsMenu';
import { sessionActions } from '../store';
const LogsPage = () => {
const dispatch = useDispatch();
const t = useTranslation();
useEffect(() => {
dispatch(sessionActions.enableLogs(true));
return () => dispatch(sessionActions.enableLogs(false));
}, []);
const items = useSelector((state) => state.session.logs);
return (
<PageLayout menu={<ReportsMenu />} breadcrumbs={['reportTitle', 'statisticsTitle']}>
<Table>
<TableHead>
<TableRow>
<TableCell>{t('deviceIdentifier')}</TableCell>
<TableCell>{t('positionProtocol')}</TableCell>
<TableCell>{t('commandData')}</TableCell>
</TableRow>
</TableHead>
<TableBody>
{items.map((item, index) => (
<TableRow key={index}>
<TableCell>{item.uniqueId}</TableCell>
<TableCell>{item.port}</TableCell>
<TableCell>{item.data}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</PageLayout>
);
};
export default LogsPage;
|