aboutsummaryrefslogtreecommitdiff
path: root/modern/src/reports
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-14 19:02:16 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-14 19:02:16 -0600
commit1e38ec1ceceeb60693b4fe3c302ce5477caddf40 (patch)
treeb440e68adfe6ccc8c69f984e28346dd5124a9344 /modern/src/reports
parent8a3dce0e58ae7a7daf1e3bf3e0e777548dfa110a (diff)
downloadetbsa-traccar-web-1e38ec1ceceeb60693b4fe3c302ce5477caddf40.tar.gz
etbsa-traccar-web-1e38ec1ceceeb60693b4fe3c302ce5477caddf40.tar.bz2
etbsa-traccar-web-1e38ec1ceceeb60693b4fe3c302ce5477caddf40.zip
Hours only shown for backhoes and tractors, changed favicon.ico, replay slider previous and back buttons, and other improvements
Diffstat (limited to 'modern/src/reports')
-rw-r--r--modern/src/reports/ReplayPage.js43
1 files changed, 29 insertions, 14 deletions
diff --git a/modern/src/reports/ReplayPage.js b/modern/src/reports/ReplayPage.js
index bb32daa..5d2b803 100644
--- a/modern/src/reports/ReplayPage.js
+++ b/modern/src/reports/ReplayPage.js
@@ -1,13 +1,17 @@
import React, { useState } from 'react';
import {
- Accordion, AccordionDetails, AccordionSummary, Container, makeStyles, Paper, Slider, Tooltip, Typography,
+ Accordion, AccordionDetails, AccordionSummary, Container, makeStyles, Paper, Slider, Tooltip, Typography, IconButton, Box
} from '@material-ui/core';
+
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
+import SkipNextIcon from '@material-ui/icons/SkipNext';
+import SkipPreviousIcon from '@material-ui/icons/SkipPrevious';
+
import MainToolbar from '../MainToolbar';
import Map from '../map/Map';
import ReplayPathMap from '../map/ReplayPathMap';
import PositionsMap from '../map/PositionsMap';
-import { formatPosition } from '../common/formatter';
+import { formatPosition, formatDate } from '../common/formatter';
import ReportFilter from './ReportFilter';
import { useTranslation } from '../LocalizationProvider';
@@ -68,18 +72,29 @@ const ReplayPage = () => {
<Container maxWidth="sm" className={classes.controlPanel}>
{!!positions.length
&& (
- <Paper className={classes.controlContent}>
- <Slider
- max={positions.length - 1}
- step={null}
- marks={positions.map((_, index) => ({ value: index }))}
- value={index}
- onChange={(_, index) => setIndex(index)}
- valueLabelDisplay="auto"
- valueLabelFormat={(i) => (i < positions.length ? formatPosition(positions[i], 'fixTime', t) : '')}
- ValueLabelComponent={TimeLabel}
- />
- </Paper>
+ <Paper className={classes.controlContent}>
+ <Box maxWidth="sm" display="flex">
+ <IconButton color="primary" disabled={index === 0} onClick={() => setIndex(index - 1)}>
+ <SkipPreviousIcon />
+ </IconButton>
+ <Box flexGrow={1} textAlign="center">
+ <Typography variant="button">{formatDate(positions[index].deviceTime)}</Typography>
+ </Box>
+ <IconButton color="primary" disabled={index === positions.length - 1} onClick={() => setIndex(index + 1)}>
+ <SkipNextIcon />
+ </IconButton>
+ </Box>
+ <Slider
+ max={positions.length - 1}
+ step={null}
+ marks={positions.map((_, index) => ({ value: index }))}
+ value={index}
+ onChange={(_, index) => setIndex(index)}
+ valueLabelDisplay="auto"
+ valueLabelFormat={(i) => (i < positions.length ? formatPosition(positions[i], 'fixTime', t) : '')}
+ ValueLabelComponent={TimeLabel}
+ />
+ </Paper>
)}
<div>
<Accordion expanded={expanded} onChange={() => setExpanded(!expanded)}>