summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-16 18:42:20 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-16 18:42:20 +0300
commitfe9b637630e8a58a68721d8ade914eff81936a5f (patch)
tree0c174bb87135ab8fb6a7a61f6f62ad2a4f4f5471 /src/store/modules
parentc4484916034f8ba3ec05fc64096abf2514b27fb9 (diff)
downloadwebui-vue-fe9b637630e8a58a68721d8ade914eff81936a5f.tar.xz
SILABMC-256: add fields for motherboard
Diffstat (limited to 'src/store/modules')
-rw-r--r--src/store/modules/HardwareStatus/MotherboardStore.js24
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