diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-22 15:47:54 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-22 15:47:54 +0300 |
commit | 5541fa8aa255edda1904631294e7c7ecb6650245 (patch) | |
tree | 11f4e89ea9bdb887a9fe475b52a2e8ed4e70e6d7 /src/store | |
parent | 1654f7790058017d8e18961b98a8994b162708c4 (diff) | |
parent | b9aa6bae1deeb200791fab52760b70eedfcb04f5 (diff) | |
download | webui-vue-5541fa8aa255edda1904631294e7c7ecb6650245.tar.xz |
merge with dynamic
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/index.js | 4 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/MemoryStore.js | 12 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/ProcessorStore.js | 12 | ||||
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/FanStore.js | 12 | ||||
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/MotherboardStore.js | 28 |
5 files changed, 67 insertions, 1 deletions
diff --git a/src/store/index.js b/src/store/index.js index 41eba75f..fa857b3a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -19,7 +19,8 @@ import ServerLedStore from './modules/HardwareStatus/ServerLedStore'; 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 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/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js index fd8f0a91..9d79ad10 100644 --- a/src/store/modules/HardwareStatus/MemoryStore.js +++ b/src/store/modules/HardwareStatus/MemoryStore.js @@ -52,8 +52,20 @@ const MemoryStore = { }; }); }, + + setMemoryDynamic: (state, data) => { + state.dimms = data; + }, }, actions: { + async getMemoryDynamic({ commit }) { + return await api + .get('/redfish/v1/TelemetryService/MetricReports/hour_data&dimm_temp') + .then(({ data: { MetricValues = [] } }) => + commit('setMemoryDynamic', MetricValues) + ) + .catch((error) => console.log(error)); + }, async getDimms({ commit }) { return await api .get('/redfish/v1/Systems/system/Memory') diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index d4c99bce..2309f536 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -59,8 +59,20 @@ const ProcessorStore = { }; }); }, + + setProcessorsDynamic: (state, data) => { + state.processors = data; + }, }, actions: { + async getProcessorsDynamic({ commit }) { + return await api + .get('/redfish/v1/TelemetryService/MetricReports/hour_data&cpu_temp') + .then(({ data: { MetricValues = [] } }) => + commit('setProcessorsDynamic', MetricValues) + ) + .catch((error) => console.log(error)); + }, async getProcessorsInfo({ commit }) { return await api .get('/redfish/v1/Systems/system/Processors') diff --git a/src/store/modules/_sila/HardwareStatus/FanStore.js b/src/store/modules/_sila/HardwareStatus/FanStore.js index 1399710b..a7647f3d 100644 --- a/src/store/modules/_sila/HardwareStatus/FanStore.js +++ b/src/store/modules/_sila/HardwareStatus/FanStore.js @@ -39,8 +39,20 @@ const FanStore = { }; }); }, + + setFansDynamic: (state, data) => { + state.fans = data; + }, }, actions: { + async getFansDynamic({ commit }) { + return await api + .get('/redfish/v1/TelemetryService/MetricReports/hour_data&fans') + .then(({ data: { MetricValues = [] } }) => + commit('setFansDynamic', MetricValues) + ) + .catch((error) => console.log(error)); + }, async getFanInfo({ commit }) { return await api .get('/redfish/v1/Chassis/chassis/Thermal') 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; |