summaryrefslogtreecommitdiff
path: root/src/store/modules/HardwareStatus/PowerSupplyStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/HardwareStatus/PowerSupplyStore.js')
-rw-r--r--src/store/modules/HardwareStatus/PowerSupplyStore.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js
index 01f70156..379bb3d1 100644
--- a/src/store/modules/HardwareStatus/PowerSupplyStore.js
+++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js
@@ -14,6 +14,7 @@ const PowerSupplyStore = {
psuCurrentLastHour: [],
powerSupplies: [],
limitsTemp: [],
+ limitsVol: [],
},
getters: {
powerSupplies: (state) => state.powerSupplies,
@@ -26,6 +27,7 @@ const PowerSupplyStore = {
psuCurrent: (state) => state.psuCurrent,
psuCurrentLastHour: (state) => state.psuCurrentLastHour,
limitsTemp: (state) => state.limitsTemp,
+ limitsVol: (state) => state.limitsTemp,
},
mutations: {
setPowerSupply: (state, data) => {
@@ -90,6 +92,9 @@ const PowerSupplyStore = {
setLimitsTemp: (state, data) => {
state.limitsTemp = data;
},
+ setLimitsVol: (state, data) => {
+ state.limitsTemp = data;
+ },
},
actions: {
async patchLimitsTemp({ dispatch }, { warning, groups }) {
@@ -120,6 +125,38 @@ const PowerSupplyStore = {
})
.catch((error) => console.log(error));
},
+ async patchLimitsVol({ dispatch }, { warning, critical, groups }) {
+ return Promise.all(
+ groups.map(
+ async (group) =>
+ await api.patch('/redfish/v1/Chassis/SILA_Baseboard/Power', {
+ Voltages: [
+ {
+ MemberId: group,
+ UpperThresholdNonCritical: warning,
+ },
+ {
+ MemberId: group,
+ UpperThresholdCritical: critical,
+ },
+ ],
+ })
+ )
+ )
+ .catch((error) => {
+ console.log(error);
+ throw new Error(i18n.t('pagePowerSup.toast.errorLimitUpdate'));
+ })
+ .finally(() => dispatch('getLimitsVol'));
+ },
+ async getLimitsVol({ commit }) {
+ return await api
+ .get('/redfish/v1/Chassis/SILA_Baseboard/Thermal')
+ .then(({ data: { Temperatures = [] } }) => {
+ commit('setLimitsVol', Temperatures);
+ })
+ .catch((error) => console.log(error));
+ },
async getPsu({ commit }, { lastHour, metricsName }) {
let url = null;
if (lastHour) {