summaryrefslogtreecommitdiff
path: root/src/store/modules/HardwareStatus/MotherboardStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/HardwareStatus/MotherboardStore.js')
-rw-r--r--src/store/modules/HardwareStatus/MotherboardStore.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/store/modules/HardwareStatus/MotherboardStore.js b/src/store/modules/HardwareStatus/MotherboardStore.js
index 09f24498..eecd3bc7 100644
--- a/src/store/modules/HardwareStatus/MotherboardStore.js
+++ b/src/store/modules/HardwareStatus/MotherboardStore.js
@@ -5,10 +5,12 @@ const MotherboardStore = {
state: {
motherboard: [],
motherboardLastHour: [],
+ limits: [],
},
getters: {
motherboard: (state) => state.motherboard,
motherboardLastHour: (state) => state.motherboardLastHour,
+ limits: (state) => state.limits,
},
mutations: {
setMotherboardDynamic: (state, data) => {
@@ -17,8 +19,36 @@ const MotherboardStore = {
setMotherboardDynamicLastHour: (state, data) => {
state.motherboardLastHour = data;
},
+ setLimits: (state, data) => {
+ state.limits = data;
+ },
},
actions: {
+ async patchLimits() {
+ return await api
+ .get('/redfish/v1/Chassis/SILA_Baseboard/Thermal')
+ .then(({ data: { Temperatures = [] } }) =>
+ Temperatures.map((temperature) =>
+ api.patch('/redfish/v1/Chassis/SILA_Baseboard/Thermal', {
+ Temperatures: [
+ {
+ MemberId: temperature.MemberId,
+ UpperThresholdNonCritical: 7,
+ },
+ ],
+ })
+ )
+ )
+ .catch((error) => console.log(error));
+ },
+ async getLimits({ commit }) {
+ return await api
+ .get('/redfish/v1/Chassis/SILA_Baseboard/Thermal')
+ .then(({ data: { Temperatures = [] } }) => {
+ commit('setLimits', Temperatures);
+ })
+ .catch((error) => console.log(error));
+ },
async getMotherboardDynamic({ commit }, { lastHour }) {
let url = null;
if (lastHour) {