mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-01 10:47:45 +00:00
Fixed results of commands
This commit is contained in:
@@ -152,16 +152,15 @@ const DeviceCommands = ({ selectedDeviceId }) => {
|
||||
setEnd(new Date());
|
||||
};
|
||||
|
||||
const getDetails = (command, commandDetails, index) => {
|
||||
const getDetails = (command, index) => {
|
||||
if (!details.includes(index)) {
|
||||
return <pre className="ignore" />;
|
||||
}
|
||||
if (command === 'reboot' || command === 'leds') {
|
||||
const result = commandDetails.results;
|
||||
if (command.results) {
|
||||
const result = command.results;
|
||||
if (result) return <pre className="ignore">{JSON.stringify(result, null, 4)}</pre>;
|
||||
}
|
||||
|
||||
return <pre className="ignore">{JSON.stringify(commandDetails, null, 4)}</pre>;
|
||||
return <pre className="ignore">{JSON.stringify(command, null, 4)}</pre>;
|
||||
};
|
||||
|
||||
const getResponse = (commandDetails, index) => {
|
||||
|
||||
@@ -7,7 +7,7 @@ const DeviceCommandsCollapse = ({ details, responses, index, item, getDetails, g
|
||||
<CCollapse show={details.includes(index)}>
|
||||
<CCardBody>
|
||||
<h5>Result</h5>
|
||||
<div>{getDetails(item.command, item, index)}</div>
|
||||
<div>{getDetails(item, index)}</div>
|
||||
</CCardBody>
|
||||
</CCollapse>
|
||||
<CCollapse show={responses.includes(index)}>
|
||||
|
||||
Reference in New Issue
Block a user