diff --git a/src/pages/DevicePage/DeviceCommands.js b/src/pages/DevicePage/DeviceCommands.js index 9354f36..aca63cf 100644 --- a/src/pages/DevicePage/DeviceCommands.js +++ b/src/pages/DevicePage/DeviceCommands.js @@ -152,16 +152,15 @@ const DeviceCommands = ({ selectedDeviceId }) => { setEnd(new Date()); }; - const getDetails = (command, commandDetails, index) => { + const getDetails = (command, index) => { if (!details.includes(index)) { return
; } - if (command === 'reboot' || command === 'leds') { - const result = commandDetails.results; + if (command.results) { + const result = command.results; if (result) return{JSON.stringify(result, null, 4)};
}
-
- return {JSON.stringify(commandDetails, null, 4)};
+ return {JSON.stringify(command, null, 4)};
};
const getResponse = (commandDetails, index) => {
diff --git a/src/pages/DevicePage/DeviceCommandsCollapse.js b/src/pages/DevicePage/DeviceCommandsCollapse.js
index be230c2..180cc26 100644
--- a/src/pages/DevicePage/DeviceCommandsCollapse.js
+++ b/src/pages/DevicePage/DeviceCommandsCollapse.js
@@ -7,7 +7,7 @@ const DeviceCommandsCollapse = ({ details, responses, index, item, getDetails, g