aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-12 19:51:20 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-12 19:51:20 -0600
commitd7edd918d1435384e2b51d8f3ce8fb61aa7e7e01 (patch)
tree6d611bd3f4bb978958a6e641b8c7506e1750acae /modern/src/map
parent5e3bbc09e614df29091f1836ce095af2825ca1a7 (diff)
downloadetbsa-traccar-web-d7edd918d1435384e2b51d8f3ce8fb61aa7e7e01.tar.gz
etbsa-traccar-web-d7edd918d1435384e2b51d8f3ce8fb61aa7e7e01.tar.bz2
etbsa-traccar-web-d7edd918d1435384e2b51d8f3ce8fb61aa7e7e01.zip
Added commands support (untested) and removed all languages except ES and EN
Diffstat (limited to 'modern/src/map')
-rw-r--r--modern/src/map/PositionsMap.js1
-rw-r--r--modern/src/map/StatusView.js26
2 files changed, 21 insertions, 6 deletions
diff --git a/modern/src/map/PositionsMap.js b/modern/src/map/PositionsMap.js
index 1e7571b..f9a2a23 100644
--- a/modern/src/map/PositionsMap.js
+++ b/modern/src/map/PositionsMap.js
@@ -61,6 +61,7 @@ const PositionsMap = ({ positions }) => {
onShowDetails={(positionId) => history.push(`/position/${positionId}`)}
onShowHistory={() => history.push('/replay')}
onEditClick={(deviceId) => history.push(`/device/${deviceId}`)}
+ onCommandsClick={(deviceId) => history.push(`/device/${deviceId}/commands`) }
/>
</ThemeProvider>
</Provider>,
diff --git a/modern/src/map/StatusView.js b/modern/src/map/StatusView.js
index aaf2882..6b6836c 100644
--- a/modern/src/map/StatusView.js
+++ b/modern/src/map/StatusView.js
@@ -4,12 +4,12 @@ import {
} from '@material-ui/core';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
-import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
import ListItemText from '@material-ui/core/ListItemText';
import { useSelector } from 'react-redux';
import ReplayIcon from '@material-ui/icons/Replay';
import EditIcon from '@material-ui/icons/Edit';
+import SendIcon from '@material-ui/icons/Send';
import DeleteIcon from '@material-ui/icons/Delete';
import LinkIcon from '@material-ui/icons/Link';
@@ -29,10 +29,14 @@ const useStyles = makeStyles((theme) => ({
listItemContainer: {
maxWidth: '300px',
},
+ listItemRoot: {
+ paddingTop: '0px',
+ paddingBottom: '0px',
+ }
}));
const StatusView = ({
- deviceId, onShowDetails, onShowHistory, onEditClick,
+ deviceId, onShowDetails, onShowHistory, onEditClick, onCommandsClick,
}) => {
const classes = useStyles();
const t = useTranslation();
@@ -54,6 +58,11 @@ const StatusView = ({
onEditClick(deviceId);
};
+ const handleCommandsClick = (e) => {
+ e.preventDefault();
+ onCommandsClick(deviceId);
+ }
+
const handleRemove = () => {
setRemoveDialogShown(true);
};
@@ -73,18 +82,18 @@ const StatusView = ({
<Grid container direction="column">
<Grid item>
<List>
- <ListItem classes={{ container: classes.listItemContainer}}>
+ <ListItem classes={{ container: classes.listItemContainer, root: classes.listItemRoot }} >
<ListItemText primary={t('positionDatetime')} secondary={formatDate(position.serverTime)} />
</ListItem>
- <ListItem classes={{ container: classes.listItemContainer }}>
+ <ListItem classes={{ container: classes.listItemContainer, root: classes.listItemRoot }}>
<ListItemText primary={t('positionSpeed')} secondary={formatSpeed(position.speed, speedUnit, t)} />
</ListItem>
{position.attributes.hours && (
- <ListItem classes={{ container: classes.listItemContainer }}>
+ <ListItem classes={{ container: classes.listItemContainer, root: classes.listItemRoot }}>
<ListItemText primary={t('positionHours')} secondary={formatHours(position.attributes.hours, t)} />
</ListItem>)}
{position.address && (
- <ListItem classes={{ container: classes.listItemContainer }}>
+ <ListItem classes={{ container: classes.listItemContainer, root: classes.listItemRoot }}>
<ListItemText primary={t('positionAddress')} secondary={position.address} />
</ListItem>)}
</List>
@@ -104,6 +113,11 @@ const StatusView = ({
</IconButton>
</Grid>
<Grid item>
+ <IconButton onClick={handleCommandsClick}>
+ <SendIcon />
+ </IconButton>
+ </Grid>
+ <Grid item>
<IconButton onClick={handleEditClick}>
<EditIcon />
</IconButton>