summaryrefslogtreecommitdiff
path: root/src/views/_sila
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-29 17:45:10 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-29 17:45:10 +0300
commit214d4d58742478b1e9ad3d0549568a92114179b8 (patch)
treef239785783a317ef36497356b13a07b02f3e1eac /src/views/_sila
parent10f5207c77b16b46f637f77520964c82226d27fb (diff)
downloadwebui-vue-214d4d58742478b1e9ad3d0549568a92114179b8.tar.xz
one req for fans, dynamic
Diffstat (limited to 'src/views/_sila')
-rw-r--r--src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue43
-rw-r--r--src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue25
-rw-r--r--src/views/_sila/Fans/Dynamic/FansDynamicPage.vue1
3 files changed, 51 insertions, 18 deletions
diff --git a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue
index b4c5dfdd..fe7b2509 100644
--- a/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue
+++ b/src/views/_sila/Fans/Dynamic/FanSpeedCpu.vue
@@ -1,7 +1,7 @@
<template>
<collapse
id="collapse_FansCpu"
- :class="{ disabledDiv: loading && opened }"
+ :class="{ disabledDiv: (loading || isPageLoading) && opened }"
:title="$t('pageFans.speed')"
:opened="true"
@opened="onOpened"
@@ -56,7 +56,9 @@
variant="primary"
style="height: 35px"
:disabled="
- loading || $store.getters['authentication/role'] === 'ReadOnly'
+ loading ||
+ isPageLoading ||
+ $store.getters['authentication/role'] === 'ReadOnly'
"
@click="saveLimit"
>
@@ -154,7 +156,7 @@ export default {
loading,
warning: null,
critical: null,
- isBusy: true,
+ isBusy: false,
opened: false,
fields: [
{
@@ -236,6 +238,10 @@ export default {
return this.$store.getters['fan/limits'];
},
+ isPageLoading() {
+ return this.$store.getters['fan/isLoading'];
+ },
+
warningLimit() {
return this.limits.find((limit) => {
return (
@@ -261,8 +267,8 @@ export default {
allSensors() {
return this.timeScale === 'hour'
- ? this.$store.getters['fan/fansCpuLastHour']
- : this.$store.getters['fan/fansCpu'];
+ ? this.$store.getters['fan/fansLastHour']
+ : this.$store.getters['fan/fans'];
},
preFiltered() {
@@ -333,23 +339,38 @@ export default {
},
loadData() {
+ if (this.isPageLoading) {
+ return;
+ }
+
let payload = { lastHour: false };
if (this.timeScale === 'hour') {
payload = { lastHour: true };
}
- this.$root.$emit('fan-cpu', true);
- this.startLoader();
- this.$store.dispatch('fan/getFansCpu', payload).finally(() => {
+ 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-cpu', false);
- this.endLoader();
- this.isBusy = false;
+ this.end();
});
});
},
+
+ start() {
+ this.startLoader();
+ this.isBusy = true;
+ this.$store.commit('fan/setIsLoading', true);
+ this.$root.$emit('fan-cpu', true);
+ },
+
+ end() {
+ this.endLoader();
+ this.isBusy = false;
+ this.$store.commit('fan/setIsLoading', false);
+ this.$root.$emit('fan-cpu', false);
+ },
},
};
</script>
diff --git a/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue b/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue
index b86e1672..a499a08d 100644
--- a/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue
+++ b/src/views/_sila/Fans/Dynamic/FanSpeedSystem.vue
@@ -1,7 +1,7 @@
<template>
<collapse
id="collapse_FansSystem"
- :class="{ disabledDiv: loading && opened }"
+ :class="{ disabledDiv: (loading || isPageLoading) && opened }"
:title="$t('pageFans.speedSystem')"
:opened="true"
@opened="onOpened"
@@ -56,7 +56,9 @@
variant="primary"
style="height: 35px"
:disabled="
- loading || $store.getters['authentication/role'] === 'ReadOnly'
+ loading ||
+ isPageLoading ||
+ $store.getters['authentication/role'] === 'ReadOnly'
"
@click="saveLimit"
>
@@ -154,7 +156,7 @@ export default {
loading,
warning: null,
critical: null,
- isBusy: true,
+ isBusy: false,
opened: false,
fields: [
{
@@ -236,6 +238,10 @@ export default {
return this.$store.getters['fan/limits'];
},
+ isPageLoading() {
+ return this.$store.getters['fan/isLoading'];
+ },
+
warningLimit() {
return this.limits.find((limit) => {
return (
@@ -261,8 +267,8 @@ export default {
allSensors() {
return this.timeScale === 'hour'
- ? this.$store.getters['fan/fansSystemLastHour']
- : this.$store.getters['fan/fansSystem'];
+ ? this.$store.getters['fan/fansLastHour']
+ : this.$store.getters['fan/fans'];
},
preFiltered() {
@@ -335,6 +341,10 @@ export default {
},
loadData() {
+ if (this.isPageLoading) {
+ return;
+ }
+
let payload = { lastHour: false };
if (this.timeScale === 'hour') {
payload = { lastHour: true };
@@ -342,13 +352,16 @@ export default {
this.$root.$emit('fan-system', true);
this.startLoader();
- this.$store.dispatch('fan/getFansSystem', payload).finally(() => {
+ this.isBusy = true;
+ this.$store.commit('fan/setIsLoading', true);
+ 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);
});
});
},
diff --git a/src/views/_sila/Fans/Dynamic/FansDynamicPage.vue b/src/views/_sila/Fans/Dynamic/FansDynamicPage.vue
index eaf3777c..ca9de7ff 100644
--- a/src/views/_sila/Fans/Dynamic/FansDynamicPage.vue
+++ b/src/views/_sila/Fans/Dynamic/FansDynamicPage.vue
@@ -47,7 +47,6 @@ export default {
},
onChangePeriod(period) {
this.timeScale = period;
- this.startProgress();
this.resetZoom();
},
startProgress() {