aboutsummaryrefslogtreecommitdiff
path: root/modern/src/CommandsPage.js
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2021-12-13 20:23:18 -0600
committerIván Ávalos <avalos@disroot.org>2021-12-13 20:23:18 -0600
commita0cd63630f67f0dec0c839cdcf53e36d1d8aebb8 (patch)
treed7ac838bb1fc683059d435f2d47879c2ba44d22b /modern/src/CommandsPage.js
parent9b1a369f7e637471ad945642b3f90135e7d03d9d (diff)
downloadetbsa-traccar-web-a0cd63630f67f0dec0c839cdcf53e36d1d8aebb8.tar.gz
etbsa-traccar-web-a0cd63630f67f0dec0c839cdcf53e36d1d8aebb8.tar.bz2
etbsa-traccar-web-a0cd63630f67f0dec0c839cdcf53e36d1d8aebb8.zip
Revamped device list and map marker popup
Diffstat (limited to 'modern/src/CommandsPage.js')
-rw-r--r--modern/src/CommandsPage.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/modern/src/CommandsPage.js b/modern/src/CommandsPage.js
index e36c365..1458b43 100644
--- a/modern/src/CommandsPage.js
+++ b/modern/src/CommandsPage.js
@@ -66,18 +66,19 @@ const CommandsPage = () => {
}, [id]);
const handleSend = async () => {
- console.log ('Selected: ' + selectedCommand);
const response = await fetch(`/api/commands/send`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
- id: selectedCommand.id,
- deviceId: device.id,
+ 'id': selectedCommand,
+ 'deviceId': device.id,
}),
});
if (response.ok) {
history.goBack();
+ } else {
+ console.log ('response!', response);
}
};
@@ -90,6 +91,7 @@ const CommandsPage = () => {
<>
<CardContent>
<Typography gutterBottom variant="h5">{t('commandSend')}</Typography>
+ <Typography variant="body2" color="text.secondary">{device.name}</Typography>
{commands && (
<FormControl fullWidth aria-label="command">
<RadioGroup onChange={(event) => setSelectedCommand(event.target.value) }>