summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-07-27 11:14:57 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-07-27 11:14:57 +0300
commit6f67757c75268bc54856008f437c3dc1c508bd18 (patch)
tree74a8628e17662cc896fa8a1faf723822fa5e410d /src/store
parent9ac77cb67aa021012aba67f2f25124ab744c339b (diff)
downloadwebui-vue-6f67757c75268bc54856008f437c3dc1c508bd18.tar.xz
upd logic for motherboard
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/_sila/HardwareStatus/MotherboardStore.js22
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)
)