diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-27 10:44:24 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-27 10:44:24 +0300 |
commit | 9ac77cb67aa021012aba67f2f25124ab744c339b (patch) | |
tree | 1f3481d4874039bcfe94cab83e55ddd7c8079302 /src/store/modules/HardwareStatus | |
parent | 6dbbe5b305be2263af559392f6efacfc961dc858 (diff) | |
download | webui-vue-9ac77cb67aa021012aba67f2f25124ab744c339b.tar.xz |
upd logic for memory
Diffstat (limited to 'src/store/modules/HardwareStatus')
-rw-r--r-- | src/store/modules/HardwareStatus/MemoryStore.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/store/modules/HardwareStatus/MemoryStore.js b/src/store/modules/HardwareStatus/MemoryStore.js index 2c8fc044..fc3e4309 100644 --- a/src/store/modules/HardwareStatus/MemoryStore.js +++ b/src/store/modules/HardwareStatus/MemoryStore.js @@ -58,19 +58,17 @@ const MemoryStore = { }, }, actions: { - async getMemoryDynamicHour({ commit }) { + async getMemoryDynamic({ commit }, { lastHour }) { + let url = null; + if (lastHour) { + url = + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=dimm_temp&period=last_hour'; + } else { + url = + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=dimm_temp'; + } return await api - .get( - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=dimm_temp&period=last_hour' - ) - .then(({ data: { MetricValues = [] } }) => - commit('setMemoryDynamic', MetricValues) - ) - .catch((error) => console.log(error)); - }, - async getMemoryDynamic({ commit }) { - return await api - .get('/redfish/v1/TelemetryService/MetricReports/hour_data&dimm_temp') + .get(url) .then(({ data: { MetricValues = [] } }) => commit('setMemoryDynamic', MetricValues) ) |