diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 12:01:39 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-07-04 12:01:39 +0300 |
commit | c8d25fd2b9ecb1395fa086a727d238489d568908 (patch) | |
tree | 3410499e78d3f1ce3225bca17f4903de4ee14f86 | |
parent | a1609142e4f59a1e731ab6472792d3cfe6014f40 (diff) | |
download | webui-vue-template-bugs.tar.xz |
fixs for cash of sensorstemplate-bugs
-rw-r--r-- | src/store/modules/HardwareStatus/SensorsStore.js | 11 | ||||
-rw-r--r-- | src/views/Fans/StaticInformation/FansStaticPage.vue | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/store/modules/HardwareStatus/SensorsStore.js b/src/store/modules/HardwareStatus/SensorsStore.js index f28c50ea..896297e3 100644 --- a/src/store/modules/HardwareStatus/SensorsStore.js +++ b/src/store/modules/HardwareStatus/SensorsStore.js @@ -5,14 +5,19 @@ const SensorsStore = { namespaced: true, state: { sensors: [], + fanSensors: [], }, getters: { sensors: (state) => state.sensors, + fanSensors: (state) => state.fanSensors, }, mutations: { setSensors: (state, sensors) => { state.sensors = uniqBy([...state.sensors, ...sensors], 'name'); }, + setFanSensors: (state, fanSensors) => { + state.fanSensors = uniqBy([...state.fanSensors, ...fanSensors], 'name'); + }, }, actions: { async getAllSensors({ dispatch }) { @@ -95,14 +100,10 @@ const SensorsStore = { name: data.Name, status: data.Status.Health, currentValue: data.Reading, - lowerCaution: data.Thresholds?.LowerCaution?.Reading, - upperCaution: data.Thresholds?.UpperCaution?.Reading, - lowerCritical: data.Thresholds?.LowerCritical?.Reading, - upperCritical: data.Thresholds?.UpperCritical?.Reading, units: data.ReadingUnits, }; }); - commit('setSensors', sensorData); + commit('setFanSensors', sensorData); }) ); }, diff --git a/src/views/Fans/StaticInformation/FansStaticPage.vue b/src/views/Fans/StaticInformation/FansStaticPage.vue index 56a5c183..a9f2d68b 100644 --- a/src/views/Fans/StaticInformation/FansStaticPage.vue +++ b/src/views/Fans/StaticInformation/FansStaticPage.vue @@ -115,7 +115,7 @@ export default { computed: { allSensors() { - let sensors = this.$store.getters['sensors/sensors']; + let sensors = this.$store.getters['sensors/fanSensors']; if (this.isSensorsExist) { sensors.forEach((sensor) => { sensor.type = sensor.name.toLowerCase().includes('cpu') @@ -128,8 +128,8 @@ export default { isSensorsExist() { return ( - this.$store.getters['sensors/sensors'] && - this.$store.getters['sensors/sensors'].length > 0 + this.$store.getters['sensors/fanSensors'] && + this.$store.getters['sensors/fanSensors'].length > 0 ); }, |