diff options
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/modules/HardwareStatus/MemoryStore.js | 22 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/MotherboardStore.js | 22 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/PowerSupplyStore.js | 38 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/ProcessorStore.js | 22 |
4 files changed, 49 insertions, 55 deletions
diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js index dd6c9a51..ae30752d 100644 --- a/src/store/modules/HardwareStatus/MemoryStore.js +++ b/src/store/modules/HardwareStatus/MemoryStore.js @@ -71,19 +71,15 @@ const MemoryStore = { }, actions: { async patchLimits({ dispatch }, { warning, groups }) { - return Promise.all( - groups.map( - async (group) => - await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { - Temperatures: [ - { - MemberId: group, - UpperThresholdNonCritical: warning, - }, - ], - }) - ) - ) + return await api + .patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { + Temperatures: groups.map((group) => { + return { + MemberId: group, + UpperThresholdNonCritical: warning, + }; + }), + }) .catch((error) => { console.log(error); throw new Error(i18n.t('pageMemory.toast.errorLimitUpdate')); diff --git a/src/store/modules/HardwareStatus/MotherboardStore.js b/src/store/modules/HardwareStatus/MotherboardStore.js index e565eaa0..0f54b529 100644 --- a/src/store/modules/HardwareStatus/MotherboardStore.js +++ b/src/store/modules/HardwareStatus/MotherboardStore.js @@ -26,19 +26,15 @@ const MotherboardStore = { }, actions: { async patchLimits({ dispatch }, { warning, groups }) { - return Promise.all( - groups.map( - async (group) => - await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { - Temperatures: [ - { - MemberId: group, - UpperThresholdNonCritical: warning, - }, - ], - }) - ) - ) + return await api + .patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { + Temperatures: groups.map((group) => { + return { + MemberId: group, + UpperThresholdNonCritical: warning, + }; + }), + }) .catch((error) => { console.log(error); throw new Error(i18n.t('pageMotherboard.toast.errorLimitUpdate')); 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')); diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index 9a09dff4..9dede45e 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -87,19 +87,15 @@ const ProcessorStore = { }, 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, - }, - ], - }) - ) - ) + return await api + .patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', { + Temperatures: groups.map((group) => { + return { + MemberId: group, + UpperThresholdNonCritical: warning, + }; + }), + }) .catch((error) => { console.log(error); throw new Error(i18n.t('pageProcessor.toast.errorLimitUpdate')); |