|
|
@ -36,15 +36,17 @@ function DeviceMonitor ({ ...props }) { |
|
|
|
useEffect(() => { |
|
|
|
if (strucParam?.thingId) { |
|
|
|
dispatch(analysis.getThingsDeploy(strucParam?.thingId, token)).then(res => { |
|
|
|
if (res.success) { |
|
|
|
const instances = res?.payload?.data?.instances; |
|
|
|
if (instances) { |
|
|
|
const deviceIds = Object.keys(instances).filter((k) => instances[k]?.type == 's.d'); |
|
|
|
dispatch(analysis.getDevicesAlarms(deviceIds, { limit: 5 }, token)); |
|
|
|
} |
|
|
|
} |
|
|
|
// if (res.success) {
|
|
|
|
// const instances = res?.payload?.data?.instances;
|
|
|
|
// if (instances) {
|
|
|
|
// const deviceIds = Object.keys(instances).filter((k) => instances[k]?.type == 's.d');
|
|
|
|
// dispatch(analysis.getDevicesAlarms(deviceIds, { limit: 5 }, token));
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}) |
|
|
|
dispatch(analysis.getDeviceMetaDeployed(strucParam?.thingId, token)) |
|
|
|
dispatch(analysis.getThingStatus({ thingId: strucParam?.thingId }, token)); |
|
|
|
|
|
|
|
} |
|
|
|
}, []); |
|
|
|
|
|
|
|