diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-27 10:01:53 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-27 10:01:53 +0300 |
commit | 6dbbe5b305be2263af559392f6efacfc961dc858 (patch) | |
tree | 61b69469c8ab0aaf3bc0b7dfdf32861461e2fc45 /src/store/modules/_sila/HardwareStatus/FanStore.js | |
parent | 1e7f107440c06ab4ecad888731cd56189627fd36 (diff) | |
download | webui-vue-6dbbe5b305be2263af559392f6efacfc961dc858.tar.xz |
upd logic for fans
Diffstat (limited to 'src/store/modules/_sila/HardwareStatus/FanStore.js')
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/FanStore.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/store/modules/_sila/HardwareStatus/FanStore.js b/src/store/modules/_sila/HardwareStatus/FanStore.js index c7b30099..d0804b80 100644 --- a/src/store/modules/_sila/HardwareStatus/FanStore.js +++ b/src/store/modules/_sila/HardwareStatus/FanStore.js @@ -45,19 +45,16 @@ const FanStore = { }, }, actions: { - async getFansDynamic({ commit }) { + async getFansDynamic({ commit }, { lastHour }) { + let url = null; + if (lastHour) { + url = + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans&period=last_hour'; + } else { + url = '/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans'; + } return await api - .get('/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans') - .then(({ data: { MetricValues = [] } }) => - commit('setFansDynamic', MetricValues) - ) - .catch((error) => console.log(error)); - }, - async getFansDynamicHour({ commit }) { - return await api - .get( - '/redfish/v1/TelemetryService/MetricReports/hour_data&id=fans&period=last_hour' - ) + .get(url) .then(({ data: { MetricValues = [] } }) => commit('setFansDynamic', MetricValues) ) |