summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-24 16:31:27 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-24 16:31:27 +0300
commitabd7265f76c5d8f9f8e9512a5e17ed8b58e288a2 (patch)
tree4eee5a1ddbfa68b28926cf154e7dcdc702d991c1 /src/store
parent25ae6bf858099a438387a1688b4e32c2e129e988 (diff)
downloadwebui-vue-abd7265f76c5d8f9f8e9512a5e17ed8b58e288a2.tar.xz
SILABMC-256: add limits for Fans
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/HardwareStatus/FanStore.js36
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'));
},