diff options
author | Anton Tananaev <anton@traccar.org> | 2022-07-03 20:18:52 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-07-03 20:18:52 -0700 |
commit | c252efc594922430ef8b728cac898cb3a956fdb7 (patch) | |
tree | a163493ee2ad0ef4268296c3484f65bdae9b49f9 /modern/src/main/StatusCard.js | |
parent | ec814fb2315f6693d2c8c394da6997db3da15397 (diff) | |
download | trackermap-web-c252efc594922430ef8b728cac898cb3a956fdb7.tar.gz trackermap-web-c252efc594922430ef8b728cac898cb3a956fdb7.tar.bz2 trackermap-web-c252efc594922430ef8b728cac898cb3a956fdb7.zip |
Add device image
Diffstat (limited to 'modern/src/main/StatusCard.js')
-rw-r--r-- | modern/src/main/StatusCard.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modern/src/main/StatusCard.js b/modern/src/main/StatusCard.js index 41cd0b53..e4734437 100644 --- a/modern/src/main/StatusCard.js +++ b/modern/src/main/StatusCard.js @@ -13,6 +13,7 @@ import { TableCell, Menu, MenuItem, + CardMedia, } from '@mui/material'; import makeStyles from '@mui/styles/makeStyles'; import CloseIcon from '@mui/icons-material/Close'; @@ -95,6 +96,8 @@ const StatusCard = ({ deviceId, onClose }) => { const device = useSelector((state) => state.devices.items[deviceId]); const position = useSelector((state) => state.positions.items[deviceId]); + const deviceImage = device?.attributes?.deviceImage; + const positionAttributes = usePositionAttributes(t); const [positionItems] = usePersistedState('positionItems', ['speed', 'address', 'totalDistance', 'course']); @@ -118,6 +121,13 @@ const StatusCard = ({ deviceId, onClose }) => { <> {device && ( <Card elevation={3} className={classes.card}> + {deviceImage && ( + <CardMedia + component="img" + height={dimensions.popupImageHeight} + image={`/api/media/${device.uniqueId}/${deviceImage}`} + /> + )} <div className={classes.header}> <Typography variant="body2" color="textSecondary"> {device.name} |