aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2023-01-03 19:28:13 -0600
committerIván Ávalos <avalos@disroot.org>2023-01-03 19:28:13 -0600
commitdc126a515783a2998aa40e7bee66b4f9846c9fe8 (patch)
tree9f168261bd104ccdd08b106528eb7907c880f630
parent3240d452cbcdf9553e47d5a95604e5c7e92924cd (diff)
downloadetbsa-traccar-web-dc126a515783a2998aa40e7bee66b4f9846c9fe8.tar.gz
etbsa-traccar-web-dc126a515783a2998aa40e7bee66b4f9846c9fe8.tar.bz2
etbsa-traccar-web-dc126a515783a2998aa40e7bee66b4f9846c9fe8.zip
Se arreglan comandos y se cambia cálculo de status
-rw-r--r--modern/src/CommandsPage.js7
-rw-r--r--modern/src/DevicesList.js2
2 files changed, 4 insertions, 5 deletions
diff --git a/modern/src/CommandsPage.js b/modern/src/CommandsPage.js
index 1458b43..3680a0d 100644
--- a/modern/src/CommandsPage.js
+++ b/modern/src/CommandsPage.js
@@ -66,13 +66,12 @@ const CommandsPage = () => {
}, [id]);
const handleSend = async () => {
+ const cmd = commands.find(c => c.id.toString() == selectedCommand);
+ cmd.deviceId = device.id;
const response = await fetch(`/api/commands/send`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({
- 'id': selectedCommand,
- 'deviceId': device.id,
- }),
+ body: JSON.stringify(cmd),
});
if (response.ok) {
diff --git a/modern/src/DevicesList.js b/modern/src/DevicesList.js
index 967ca82..1bc1fa7 100644
--- a/modern/src/DevicesList.js
+++ b/modern/src/DevicesList.js
@@ -96,7 +96,7 @@ const DeviceRow = ({ data, index, style }) => {
const showIgnition = position?.attributes.hasOwnProperty('ignition') && position.attributes.ignition === true;
const statusColor = () => {
- if (position && position.speed >= 2) {
+ if (item.status == "online") {
return 'primary';
} else {
return 'error';