diff options
Diffstat (limited to 'src/store/modules/HardwareStatus/FanStore.js')
-rw-r--r-- | src/store/modules/HardwareStatus/FanStore.js | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/store/modules/HardwareStatus/FanStore.js b/src/store/modules/HardwareStatus/FanStore.js index 9bc84280..8cae4d77 100644 --- a/src/store/modules/HardwareStatus/FanStore.js +++ b/src/store/modules/HardwareStatus/FanStore.js @@ -54,23 +54,29 @@ const FanStore = { }, }, actions: { - async patchLimits({ dispatch }, { warning, groups }) { - return Promise.all( - groups.map( - async (group) => - await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { - Speed: [ - { - MemberId: group, - UpperThresholdNonCritical: warning, - }, - ], - }) - ) - ) + async patchLimits({ dispatch }, { warning, critical, groups }) { + return await api + .patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { + Fans: groups.map((group) => { + return { + MemberId: group, + UpperThresholdNonCritical: warning, + }; + }), + }) + .then(async () => { + return await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { + Fans: groups.map((group) => { + return { + MemberId: group, + UpperThresholdCritical: critical, + }; + }), + }); + }) .catch((error) => { console.log(error); - throw new Error(i18n.t('pageMotherboard.toast.errorLimitUpdate')); + throw new Error(i18n.t('pageMemory.toast.errorLimitUpdate')); }) .finally(() => dispatch('getLimits')); }, |