diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-25 12:16:17 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-25 12:16:17 +0300 |
commit | 0847eaf4cc4b050fc6f297940013a3e7e4c1cb81 (patch) | |
tree | d30763106339ce9f0b2c1ea3d7b594915257755a /src/store | |
parent | dc974638f3ea285f8da00a1a084d08ce3ede8949 (diff) | |
download | webui-vue-0847eaf4cc4b050fc6f297940013a3e7e4c1cb81.tar.xz |
SILABMC-256: add limits for Voltage
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/modules/HardwareStatus/PowerSupplyStore.js | 42 |
1 files changed, 22 insertions, 20 deletions
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)); }, |