diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-27 11:14:57 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-27 11:14:57 +0300 |
commit | 6f67757c75268bc54856008f437c3dc1c508bd18 (patch) | |
tree | 74a8628e17662cc896fa8a1faf723822fa5e410d /src/store/modules/_sila/HardwareStatus | |
parent | 9ac77cb67aa021012aba67f2f25124ab744c339b (diff) | |
download | webui-vue-6f67757c75268bc54856008f437c3dc1c508bd18.tar.xz |
upd logic for motherboard
Diffstat (limited to 'src/store/modules/_sila/HardwareStatus')
-rw-r--r-- | src/store/modules/_sila/HardwareStatus/MotherboardStore.js | 22 |
1 files changed, 10 insertions, 12 deletions
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) ) |