aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/DevicesList.js50
1 files changed, 25 insertions, 25 deletions
diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js
index fda6f60..b7222a2 100644
--- a/modern/src/DevicesList.js
+++ b/modern/src/DevicesList.js
@@ -116,44 +116,44 @@ const DeviceRow = ({ data, index, style }) => {
return (
<div style={style}>
<ListItem button key={item.id} className={classes.listItem} onClick={() => {
- dispatch(devicesActions.select(item));
- dispatch(uiActions.setCollapsed(true));
- setTimeout (() => {
- dispatch(devicesActions.unselect());
- }, 1000);
+ dispatch(devicesActions.select(item));
+ dispatch(uiActions.setCollapsed(true));
+ setTimeout(() => {
+ dispatch(devicesActions.unselect());
+ }, 1000);
}}>
{/* Avatar */}
<ListItemAvatar>
<img className={classes.icon} src={`images/icon/${(item.category || 'default').toLowerCase()}.png`} alt="" />
</ListItemAvatar>
{/* Status icon */}
-
+
<ListItemText primary={
<>
- <FiberManualRecordIcon fontSize="inherit" color={statusColor()} classes={{ colorPrimary: classes.green }} />
+ <FiberManualRecordIcon fontSize="inherit" color={statusColor()} classes={{ colorPrimary: classes.green }} />
{position && position.attributes.out1 == false && (
<LockOpenIcon fontSize="inherit" color="primary" classes={{ colorPrimary: classes.green }} />
)}
{position && position.attributes.out1 == true && (
<LockIcon fontSize="inherit" color="error" />
- ) }
+ )}
{` ${item.name}`}
</>} secondary={(
- <>
- {/* Contact */}
- <PersonIcon fontSize="inherit" /> {item.contact}<br/>
- {position && (
- <>
- {/* Speed */}
- <SpeedIcon fontSize="inherit" /> {formatSpeed(position.speed, speedUnit, t)}<br/>
- {/* Datetime */}
- <CalendarTodayIcon fontSize="inherit" /> {formatDate(position.serverTime)}
- {/* Hours */}
- {position.attributes.hours && position.attributes.hours > 1 && ` (${formatHours(position.attributes.hours, t)})`}
- </>
- )}
- </>
- )} classes={{ secondary: classes.listItemSecondary }} />
+ <>
+ {/* Contact */}
+ <PersonIcon fontSize="inherit" /> {item.contact}<br />
+ {position && (
+ <>
+ {/* Speed */}
+ <SpeedIcon fontSize="inherit" /> {formatSpeed(position.speed, speedUnit, t)}<br />
+ {/* Datetime */}
+ <CalendarTodayIcon fontSize="inherit" /> {formatDate(position.serverTime)}
+ {/* Hours */}
+ {position.attributes.hours && position.attributes.hours > 1 && ` (${formatHours(position.attributes.hours, t)})`}
+ </>
+ )}
+ </>
+ )} classes={{ secondary: classes.listItemSecondary }} />
<ListItemSecondaryAction className={classes.indicators}>
{position && (
<Grid container direction="row" alignItems="center" alignContent="center" spacing={2}>
@@ -189,7 +189,7 @@ const DeviceView = ({ updateTimestamp, onMenuClick }) => {
const filteredItems = useSelector(getFilteredDevices);
const unfilteredItems = useSelector(getDevices);
-
+
const items = filteredItems.length > 0 ? filteredItems : unfilteredItems;
if (listInnerEl.current) {
@@ -211,7 +211,7 @@ const DeviceView = ({ updateTimestamp, onMenuClick }) => {
width={width}
height={height}
itemCount={items.length}
- itemData={{items, onMenuClick}}
+ itemData={{ items, onMenuClick }}
itemSize={144}
overscanCount={10}
innerRef={listInnerEl}