diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-22 12:16:07 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-22 12:16:07 +0300 |
commit | 381cc079a34a56d3b6f1bd78e52086d94814df80 (patch) | |
tree | d82851fe97dd7459b5cfdc52380681b7e3f0d9ca /src/store | |
parent | 7cba13534cda94a1efdbad2ff8dbe68de1fbeaa3 (diff) | |
download | webui-vue-381cc079a34a56d3b6f1bd78e52086d94814df80.tar.xz |
add motherboard6 fix others
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/index.js | 2 | ||||
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/MotherboardStore.js | 28 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/store/index.js b/src/store/index.js index 11183e00..fa857b3a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -20,6 +20,7 @@ import SystemStore from './modules/HardwareStatus/SystemStore'; import PowerSupplyStore from './modules/HardwareStatus/PowerSupplyStore'; import MemoryStore from './modules/HardwareStatus/MemoryStore'; import FanStore from './modules/_sila/HardwareStatus/FanStore'; +import MotherboardStore from './modules/_sila/HardwareStatus/MotherboardStore'; import ChassisStore from './modules/HardwareStatus/ChassisStore'; import BmcStore from './modules/HardwareStatus/BmcStore'; import ProcessorStore from './modules/HardwareStatus/ProcessorStore'; @@ -60,6 +61,7 @@ export default new Vuex.Store({ system: SystemStore, memory: MemoryStore, fan: FanStore, + motherboard: MotherboardStore, chassis: ChassisStore, bmc: BmcStore, processors: ProcessorStore, diff --git a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js new file mode 100644 index 00000000..93d655f9 --- /dev/null +++ b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js @@ -0,0 +1,28 @@ +import api from '@/store/api'; + +const MotherboardStore = { + namespaced: true, + state: { + motherboard: [], + }, + getters: { + motherboard: (state) => state.motherboard, + }, + mutations: { + setMotherboardDynamic: (state, data) => { + state.motherboard = data; + }, + }, + actions: { + async getMotherboardDynamic({ commit }) { + return await api + .get('/redfish/v1/TelemetryService/MetricReports/hour_data&other_temp') + .then(({ data: { MetricValues = [] } }) => + commit('setMotherboardDynamic', MetricValues) + ) + .catch((error) => console.log(error)); + }, + }, +}; + +export default MotherboardStore; |