summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-17 15:27:13 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-17 15:27:13 +0300
commitf73b682a5cc44f2b4e60a4b22622b0c59a9b4a9a (patch)
tree48a407a81c5bbaa71682d5b19f0265105a14b423 /src/store
parent67dab376eb97139c5dba14b441c6d9cede62fb2e (diff)
downloadwebui-vue-f73b682a5cc44f2b4e60a4b22622b0c59a9b4a9a.tar.xz
SILABMC-256: add validation and upd limits layout
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/HardwareStatus/MemoryStore.js22
-rw-r--r--src/store/modules/HardwareStatus/MotherboardStore.js22
-rw-r--r--src/store/modules/HardwareStatus/PowerSupplyStore.js38
-rw-r--r--src/store/modules/HardwareStatus/ProcessorStore.js22
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'));