summaryrefslogtreecommitdiff
path: root/src/store/modules/HardwareStatus/ProcessorStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/HardwareStatus/ProcessorStore.js')
-rw-r--r--src/store/modules/HardwareStatus/ProcessorStore.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js
index 68b29ab6..9a09dff4 100644
--- a/src/store/modules/HardwareStatus/ProcessorStore.js
+++ b/src/store/modules/HardwareStatus/ProcessorStore.js
@@ -8,12 +8,14 @@ const ProcessorStore = {
cpuPower: [],
cpuTempLastHour: [],
cpuPowerLastHour: [],
+ limitsTemp: [],
},
getters: {
cpuTemp: (state) => state.cpuTemp,
cpuPower: (state) => state.cpuPower,
cpuTempLastHour: (state) => state.cpuTempLastHour,
cpuPowerLastHour: (state) => state.cpuPowerLastHour,
+ limitsTemp: (state) => state.limitsTemp,
},
mutations: {
setProcessorsInfo: (state, data) => {
@@ -78,8 +80,40 @@ const ProcessorStore = {
setCpuPowerDynamicLastHour: (state, data) => {
state.cpuPowerLastHour = data;
},
+
+ setLimitsTemp: (state, data) => {
+ state.limitsTemp = 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,
+ },
+ ],
+ })
+ )
+ )
+ .catch((error) => {
+ console.log(error);
+ throw new Error(i18n.t('pageProcessor.toast.errorLimitUpdate'));
+ })
+ .finally(() => dispatch('getLimitsTemp'));
+ },
+ async getLimitsTemp({ commit }) {
+ return await api
+ .get('/redfish/v1/Chassis/SILA_Baseboard/Thermal')
+ .then(({ data: { Temperatures = [] } }) => {
+ commit('setLimitsTemp', Temperatures);
+ })
+ .catch((error) => console.log(error));
+ },
async getCpuPowerDynamic({ commit }, { lastHour }) {
let url = null;
if (lastHour) {