diff options
Diffstat (limited to 'src/store/modules/_sila/HardwareStatus/MotherboardStore.js')
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/MotherboardStore.js | 28 |
1 files changed, 28 insertions, 0 deletions
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; |