diff options
Diffstat (limited to 'src/store/modules/_sila/HardwareStatus/MotherboardStore.js')
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/MotherboardStore.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js index 1099b4a7..7b2fe032 100644 --- a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js +++ b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js @@ -4,14 +4,19 @@ const MotherboardStore = { namespaced: true, state: { motherboard: [], + motherboardLastHour: [], }, getters: { motherboard: (state) => state.motherboard, + motherboardLastHour: (state) => state.motherboardLastHour, }, mutations: { setMotherboardDynamic: (state, data) => { state.motherboard = data; }, + setMotherboardDynamicLastHour: (state, data) => { + state.motherboardLastHour = data; + }, }, actions: { async getMotherboardDynamic({ commit }, { lastHour }) { @@ -25,9 +30,13 @@ const MotherboardStore = { } return await api .get(url) - .then(({ data: { MetricValues = [] } }) => - commit('setMotherboardDynamic', MetricValues) - ) + .then(({ data: { MetricValues = [] } }) => { + if (lastHour) { + commit('setMotherboardDynamicLastHour', MetricValues); + } else { + commit('setMotherboardDynamic', MetricValues); + } + }) .catch((error) => console.log(error)); }, }, |