summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-17 10:29:19 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-17 10:29:19 +0300
commit362937100773d9180a821e9ee4c1a872c406478a (patch)
tree62632362ff5acfe8e87d175c78fb60a2cd381e01 /src/store/modules
parent0237b9c60425bbcd2417bf31000cbd74d0112645 (diff)
downloadwebui-vue-362937100773d9180a821e9ee4c1a872c406478a.tar.xz
SILABMC-256: add fields for power, vol input
Diffstat (limited to 'src/store/modules')
-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) {