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