From 6f67757c75268bc54856008f437c3dc1c508bd18 Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Wed, 27 Jul 2022 11:14:57 +0300 Subject: upd logic for motherboard --- .../_sila/HardwareStatus/MotherboardStore.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/store/modules') diff --git a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js index 71b71065..1099b4a7 100644 --- a/src/store/modules/_sila/HardwareStatus/MotherboardStore.js +++ b/src/store/modules/_sila/HardwareStatus/MotherboardStore.js @@ -14,19 +14,17 @@ const MotherboardStore = { }, }, actions: { - async getMotherboardDynamicHour({ commit }) { + async getMotherboardDynamic({ commit }, { lastHour }) { + let url = null; + if (lastHour) { + url = + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp&period=last_hour'; + } else { + url = + '/redfish/v1/TelemetryService/MetricReports/hour_data&id=other_temp'; + } 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') + .get(url) .then(({ data: { MetricValues = [] } }) => commit('setMotherboardDynamic', MetricValues) ) -- cgit v1.2.3