diff options
author | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-26 14:50:55 +0300 |
---|---|---|
committer | Vitalii Lysak <v.lysak@dunice.net> | 2022-08-26 14:50:55 +0300 |
commit | 5463c8aec08dfa07a01f95646e44a3b4bee070fe (patch) | |
tree | dc862824cffa5284db6c57308b0445071fbd2c5e /src/views/_sila/Processors/Dynamic/CpuTemp.vue | |
parent | 81e43ed3e15e2857faafc56edaf15ea1e1f63ec0 (diff) | |
download | webui-vue-5463c8aec08dfa07a01f95646e44a3b4bee070fe.tar.xz |
optimization for dynamic
Diffstat (limited to 'src/views/_sila/Processors/Dynamic/CpuTemp.vue')
-rw-r--r-- | src/views/_sila/Processors/Dynamic/CpuTemp.vue | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/views/_sila/Processors/Dynamic/CpuTemp.vue b/src/views/_sila/Processors/Dynamic/CpuTemp.vue index f4e9a49f..f33b328a 100644 --- a/src/views/_sila/Processors/Dynamic/CpuTemp.vue +++ b/src/views/_sila/Processors/Dynamic/CpuTemp.vue @@ -1,7 +1,9 @@ <template> <collapse id="collapse_temp" + :class="{ disabledDiv: loading && opened }" :title="$t('pageProcessors.temperature')" + :opened="true" @opened="onOpened" > <template #image> @@ -147,6 +149,7 @@ export default { warning: null, critical: null, isBusy: true, + opened: false, fields: [ { key: 'name', @@ -251,12 +254,14 @@ export default { watch: { timeScale() { + if (!this.opened) { + return; + } + this.loadData(); }, }, - created() { - this.loadData(); - }, + methods: { saveLimit() { this.$v.$touch(); @@ -276,6 +281,7 @@ export default { if (state) { this.loadData(); } + this.opened = state; }, loadData() { @@ -284,6 +290,7 @@ export default { payload = { lastHour: true }; } + this.$root.$emit('cpu-temp', true); this.startLoader(); this.$store .dispatch('processors/getCpuTempDynamic', payload) @@ -291,6 +298,7 @@ export default { this.$store.dispatch('processors/getLimitsTemp').finally(() => { this.warning = this.warningLimit; this.critical = this.criticalLimit; + this.$root.$emit('cpu-temp', false); this.endLoader(); this.isBusy = false; }); |