summaryrefslogtreecommitdiff
path: root/src/store/modules/HardwareStatus/SensorsStore.js
diff options
context:
space:
mode:
authorkirankumarb07 <kirankumarb@ami.com>2023-01-11 15:54:40 +0300
committerSandeepa Singh <sandeepa.singh@ibm.com>2023-02-02 17:17:39 +0300
commit9298ea3f3127cd9310238136f5712384c9b25117 (patch)
tree0aac2ecf26f02fd2c225249cfaee96e3914a7b74 /src/store/modules/HardwareStatus/SensorsStore.js
parentc72f1e3e1e87a17faf649b6b4b8fbfd166a11b76 (diff)
downloadwebui-vue-9298ea3f3127cd9310238136f5712384c9b25117.tar.xz
Fixed sensor mismatch issue with IPMI and redfish
Description: The sensor count in WebUI is mismatched when compared to IPMI and REDFISH responses. When Web UI is iterating the sensor response property, the iteration is stopped when the key value is undefined. As a result, the sensor details in the web UI are incorrect. So added the code changes to check the property value in every iteration, whether the value is present or not. Tested: Step 1: Login to WEB UI Step 2: Navigate to Hardware Status and Sensors Step 3: Check the sensor details with IPMI and redfish response Step 4: All the sensors and those details in the IPMI and redfish response are listing in Web UI Change-Id: Icf5098b3dd2413851e755d9ede17a8501cbb7411 Signed-off-by: Kirankumar Ballapalli <kirankumarb@ami.com>
Diffstat (limited to 'src/store/modules/HardwareStatus/SensorsStore.js')
-rw-r--r--src/store/modules/HardwareStatus/SensorsStore.js35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/store/modules/HardwareStatus/SensorsStore.js b/src/store/modules/HardwareStatus/SensorsStore.js
index cae7795f..5a237bd4 100644
--- a/src/store/modules/HardwareStatus/SensorsStore.js
+++ b/src/store/modules/HardwareStatus/SensorsStore.js
@@ -46,23 +46,24 @@ const SensorsStore = {
return error;
});
});
- return await api.all(promises).then(
- api.spread((...responses) => {
- const sensorData = responses.map(({ data }) => {
- return {
- name: data.Name,
- status: data.Status.Health,
- currentValue: data.Reading,
- lowerCaution: data.Thresholds?.LowerCaution?.Reading,
- upperCaution: data.Thresholds?.UpperCaution?.Reading,
- lowerCritical: data.Thresholds?.LowerCritical?.Reading,
- upperCritical: data.Thresholds?.UpperCritical?.Reading,
- units: data.ReadingUnits,
- };
- });
- commit('setSensors', sensorData);
- })
- );
+ return await api.all(promises).then((responses) => {
+ const sensorData = [];
+ responses.forEach((response) => {
+ if (response.data) {
+ sensorData.push({
+ name: response.data.Name,
+ status: response.data.Status?.Health,
+ currentValue: response.data.Reading,
+ lowerCaution: response.data.Thresholds?.LowerCaution?.Reading,
+ upperCaution: response.data.Thresholds?.UpperCaution?.Reading,
+ lowerCritical: response.data.Thresholds?.LowerCritical?.Reading,
+ upperCritical: response.data.Thresholds?.UpperCritical?.Reading,
+ units: response.data.ReadingUnits,
+ });
+ }
+ });
+ commit('setSensors', sensorData);
+ });
},
async getThermalSensors({ commit }, id) {
return await api