summaryrefslogtreecommitdiff
path: root/src/store/modules/_sila/HardwareStatus/MotherboardStore.js
blob: 71b7106531abe1ba7c6c5ed73298d313c8c5ccbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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 getMotherboardDynamicHour({ commit }) {
      return await api
        .get(
          '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp&period=last_hour'
        )
        .then(({ data: { MetricValues = [] } }) =>
          commit('setMotherboardDynamic', MetricValues)
        )
        .catch((error) => console.log(error));
    },
    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;