aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-06-02 21:41:16 -0600
committerIván Ávalos <avalos@disroot.org>2023-06-02 21:41:16 -0600
commit2e791f80b8f08ab0db469c0d24453903fed7eed8 (patch)
tree219d442fc06e8b3d0319588aaca9f9035e5d3150
parent6ce874d5ecc29051cf5eadded822d7a0e5930af1 (diff)
downloadetbsa-traccar-web-2e791f80b8f08ab0db469c0d24453903fed7eed8.tar.gz
etbsa-traccar-web-2e791f80b8f08ab0db469c0d24453903fed7eed8.tar.bz2
etbsa-traccar-web-2e791f80b8f08ab0db469c0d24453903fed7eed8.zip
Se corrige candado para Suntech nuevos
-rw-r--r--modern/src/DevicesList.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js
index fb89260..7a60e8e 100644
--- a/modern/src/DevicesList.js
+++ b/modern/src/DevicesList.js
@@ -117,6 +117,17 @@ const DeviceRow = ({ data, index, style }) => {
return null;
}
+ const getPositionLock = (pos) => {
+ if (pos) {
+ if (pos.attributes.output !== undefined) {
+ return pos.attributes.output === 1;
+ } else if (pos.attributes.out1 !== undefined) {
+ return pos.attributes.out1;
+ }
+ }
+ return null;
+ }
+
return (
<div style={style}>
<ListItem button key={item.id} className={classes.listItem} onClick={() => {
@@ -135,10 +146,10 @@ const DeviceRow = ({ data, index, style }) => {
<ListItemText primary={
<Typography noWrap>
<FiberManualRecordIcon fontSize="inherit" color={statusColor()} classes={{ colorPrimary: classes.green }} />
- {position && position.attributes.out1 == false && (
+ {getPositionLock(position) === false && (
<LockOpenIcon fontSize="inherit" color="primary" classes={{ colorPrimary: classes.green }} />
)}
- {position && position.attributes.out1 == true && (
+ {getPositionLock(position) === true && (
<LockIcon fontSize="inherit" color="error" />
)}
{` ${item.name}`}