From 0847eaf4cc4b050fc6f297940013a3e7e4c1cb81 Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Thu, 25 Aug 2022 12:16:17 +0300 Subject: SILABMC-256: add limits for Voltage --- .../modules/HardwareStatus/PowerSupplyStore.js | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'src/store') diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js index 567908f2..e70d8dd0 100644 --- a/src/store/modules/HardwareStatus/PowerSupplyStore.js +++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js @@ -132,23 +132,25 @@ const PowerSupplyStore = { .catch((error) => console.log(error)); }, async patchLimitsVol({ dispatch }, { warning, critical, groups }) { - return Promise.all( - groups.map( - async (group) => - await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Power', { - Voltages: [ - { - MemberId: group, - UpperThresholdNonCritical: warning, - }, - { - MemberId: group, - UpperThresholdCritical: critical, - }, - ], - }) - ) - ) + return await api + .patch('/redfish/v1/Chassis/SILA_Baseboard/Power', { + Voltages: groups.map((group) => { + return { + MemberId: group, + UpperThresholdNonCritical: warning, + }; + }), + }) + .then(async () => { + return await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Power', { + Voltages: groups.map((group) => { + return { + MemberId: group, + UpperThresholdCritical: critical, + }; + }), + }); + }) .catch((error) => { console.log(error); throw new Error(i18n.t('pagePowerSup.toast.errorLimitUpdate')); @@ -157,9 +159,9 @@ const PowerSupplyStore = { }, async getLimitsVol({ commit }) { return await api - .get('/redfish/v1/Chassis/SILA_Baseboard/Thermal') - .then(({ data: { Temperatures = [] } }) => { - commit('setLimitsVol', Temperatures); + .get('/redfish/v1/Chassis/SILA_Baseboard/Power') + .then(({ data: { Voltages = [] } }) => { + commit('setLimitsVol', Voltages); }) .catch((error) => console.log(error)); }, -- cgit v1.2.3