diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-16 13:16:28 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-16 13:16:28 +0300 |
commit | 7d5e7b6f494c16640790734c39ffb2f1ed511358 (patch) | |
tree | c7bf34cb586a5a1313c3f15673d34996796c167c /src/store | |
parent | 3e22d1b10a4bd2b9e998aaaf25b388377b3953da (diff) | |
download | webui-vue-7d5e7b6f494c16640790734c39ffb2f1ed511358.tar.xz |
SILABMC-256: patch/get for limits
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/modules/HardwareStatus/MotherboardStore.js | 30 |
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) { |