summaryrefslogtreecommitdiff
path: root/src/store/modules/HardwareStatus/PowerSupplyStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/HardwareStatus/PowerSupplyStore.js')
-rw-r--r--src/store/modules/HardwareStatus/PowerSupplyStore.js38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js
index 379bb3d1..567908f2 100644
--- a/src/store/modules/HardwareStatus/PowerSupplyStore.js
+++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js
@@ -27,7 +27,7 @@ const PowerSupplyStore = {
psuCurrent: (state) => state.psuCurrent,
psuCurrentLastHour: (state) => state.psuCurrentLastHour,
limitsTemp: (state) => state.limitsTemp,
- limitsVol: (state) => state.limitsTemp,
+ limitsVol: (state) => state.limitsVol,
},
mutations: {
setPowerSupply: (state, data) => {
@@ -93,24 +93,30 @@ const PowerSupplyStore = {
state.limitsTemp = data;
},
setLimitsVol: (state, data) => {
- state.limitsTemp = data;
+ state.limitsVol = data;
},
},
actions: {
- async patchLimitsTemp({ dispatch }, { warning, groups }) {
- return Promise.all(
- groups.map(
- async (group) =>
- await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', {
- Temperatures: [
- {
- MemberId: group,
- UpperThresholdNonCritical: warning,
- },
- ],
- })
- )
- )
+ async patchLimitsTemp({ dispatch }, { warning, critical, groups }) {
+ return await api
+ .patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', {
+ Temperatures: groups.map((group) => {
+ return {
+ MemberId: group,
+ UpperThresholdNonCritical: warning,
+ };
+ }),
+ })
+ .then(async () => {
+ return await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', {
+ Temperatures: groups.map((group) => {
+ return {
+ MemberId: group,
+ UpperThresholdCritical: critical,
+ };
+ }),
+ });
+ })
.catch((error) => {
console.log(error);
throw new Error(i18n.t('pagePowerSup.toast.errorLimitUpdate'));