summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules')
-rw-r--r--src/store/modules/_sila/HardwareStatus/FanStore.js21
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)
)