summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-25 12:16:17 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-25 12:16:17 +0300
commit0847eaf4cc4b050fc6f297940013a3e7e4c1cb81 (patch)
treed30763106339ce9f0b2c1ea3d7b594915257755a /src/store/modules
parentdc974638f3ea285f8da00a1a084d08ce3ede8949 (diff)
downloadwebui-vue-0847eaf4cc4b050fc6f297940013a3e7e4c1cb81.tar.xz
SILABMC-256: add limits for Voltage
Diffstat (limited to 'src/store/modules')
-rw-r--r--src/store/modules/HardwareStatus/PowerSupplyStore.js42
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));
},