diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-16 18:42:20 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-16 18:42:20 +0300 |
commit | fe9b637630e8a58a68721d8ade914eff81936a5f (patch) | |
tree | 0c174bb87135ab8fb6a7a61f6f62ad2a4f4f5471 /src/store/modules/HardwareStatus | |
parent | c4484916034f8ba3ec05fc64096abf2514b27fb9 (diff) | |
download | webui-vue-fe9b637630e8a58a68721d8ade914eff81936a5f.tar.xz |
SILABMC-256: add fields for motherboard
Diffstat (limited to 'src/store/modules/HardwareStatus')
-rw-r--r-- | src/store/modules/HardwareStatus/MotherboardStore.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/store/modules/HardwareStatus/MotherboardStore.js b/src/store/modules/HardwareStatus/MotherboardStore.js index eecd3bc7..e565eaa0 100644 --- a/src/store/modules/HardwareStatus/MotherboardStore.js +++ b/src/store/modules/HardwareStatus/MotherboardStore.js @@ -1,4 +1,5 @@ import api from '@/store/api'; +import i18n from '@/i18n'; const MotherboardStore = { namespaced: true, @@ -24,22 +25,25 @@ const MotherboardStore = { }, }, actions: { - async patchLimits() { - return await api - .get('/redfish/v1/Chassis/SILA_Baseboard/Thermal') - .then(({ data: { Temperatures = [] } }) => - Temperatures.map((temperature) => - api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { + async patchLimits({ dispatch }, { warning, groups }) { + return Promise.all( + groups.map( + async (group) => + await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { Temperatures: [ { - MemberId: temperature.MemberId, - UpperThresholdNonCritical: 7, + MemberId: group, + UpperThresholdNonCritical: warning, }, ], }) - ) ) - .catch((error) => console.log(error)); + ) + .catch((error) => { + console.log(error); + throw new Error(i18n.t('pageMotherboard.toast.errorLimitUpdate')); + }) + .finally(() => dispatch('getLimits')); }, async getLimits({ commit }) { return await api |