summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-29 17:54:37 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-29 17:54:37 +0300
commit6cf3e66bcafbe161e9d9f7f3218f5944b4681658 (patch)
tree7b63c9643759dac1e5f650408071d1134c6e85a9
parent7bbec9daea219689c6c86d041eb20e7101a43519 (diff)
downloadwebui-vue-6cf3e66bcafbe161e9d9f7f3218f5944b4681658.tar.xz
fx fans
-rw-r--r--src/store/modules/HardwareStatus/FanStore.js8
-rw-r--r--src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue24
2 files changed, 20 insertions, 12 deletions
diff --git a/src/store/modules/HardwareStatus/FanStore.js b/src/store/modules/HardwareStatus/FanStore.js
index 43baf6b1..69e18532 100644
--- a/src/store/modules/HardwareStatus/FanStore.js
+++ b/src/store/modules/HardwareStatus/FanStore.js
@@ -10,8 +10,8 @@ const FanStore = {
isLoading: false,
},
getters: {
- fans: (state) => state.fansCpu,
- fansLastHour: (state) => state.fansCpuLastHour,
+ fans: (state) => state.fans,
+ fansLastHour: (state) => state.fansLastHour,
limits: (state) => state.limits,
isLoading: (state) => state.isLoading,
},
@@ -46,10 +46,10 @@ const FanStore = {
},
setFans: (state, data) => {
- state.fansCpu = data;
+ state.fans = data;
},
setFansLastHour: (state, data) => {
- state.fansCpuLastHour = data;
+ state.fansLastHour = data;
},
setLimits: (state, data) => {
state.limits = data;
diff --git a/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue b/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue
index a499a08d..a9582b2a 100644
--- a/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue
+++ b/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue
@@ -350,21 +350,29 @@ export default {
payload = { lastHour: true };
}
- this.$root.$emit('fan-system', true);
- this.startLoader();
- this.isBusy = true;
- this.$store.commit('fan/setIsLoading', true);
+ this.start();
this.$store.dispatch('fan/getFans', payload).finally(() => {
this.$store.dispatch('fan/getLimits').finally(() => {
this.warning = this.warningLimit;
this.critical = this.criticalLimit;
- this.$root.$emit('fan-system', false);
- this.endLoader();
- this.isBusy = false;
- this.$store.commit('fan/setIsLoading', false);
+ this.end();
});
});
},
+
+ start() {
+ this.startLoader();
+ this.isBusy = true;
+ this.$store.commit('fan/setIsLoading', true);
+ this.$root.$emit('fan-system', true);
+ },
+
+ end() {
+ this.endLoader();
+ this.isBusy = false;
+ this.$store.commit('fan/setIsLoading', false);
+ this.$root.$emit('fan-system', false);
+ },
},
};
</script>