summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Lysak <v.lysak@dunice.net>2022-08-30 08:14:18 +0300
committerVitalii Lysak <v.lysak@dunice.net>2022-08-30 08:14:18 +0300
commit2aa0a1a6e2f6399a51cad5b73a3611092697a59a (patch)
tree9c64f17e2442d79fb9ff1ca2c291c53a4423b589
parente63106793578f1967e753fb813e47a3cfa238044 (diff)
downloadwebui-vue-2aa0a1a6e2f6399a51cad5b73a3611092697a59a.tar.xz
upd memoru, dynamic
-rw-r--r--src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue22
-rw-r--r--src/views/_sila/Memory/Dynamic/MemoryTemp.vue21
2 files changed, 36 insertions, 7 deletions
diff --git a/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue b/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue
index 10496829..16c8202f 100644
--- a/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue
+++ b/src/views/_sila/Memory/Dynamic/MemoryDynamicPage.vue
@@ -1,7 +1,11 @@
<template>
<b-container fluid="xl">
<page-title :description="$t('appPageTitle.dynamicInformation')" />
- <table-date-picker :time-scale="timeScale" @changePeriod="onChangePeriod" />
+ <table-date-picker
+ :class="{ disabledDiv: loading }"
+ :time-scale="timeScale"
+ @changePeriod="onChangePeriod"
+ />
<memory-temp :time-scale="timeScale"></memory-temp>
</b-container>
</template>
@@ -11,7 +15,9 @@ import PageTitle from '@/components/_sila/Global/PageTitle';
import TableDatePicker from '@/components/_sila/Global/TableDatePicker';
import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin';
-import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin';
+import LoadingBarMixin, {
+ loading,
+} from '@/components/_sila/Mixins/LoadingBarMixin';
import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin';
import MemoryTemp from './MemoryTemp';
@@ -21,10 +27,15 @@ export default {
mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin],
data() {
return {
+ loading,
timeScale: 'hour',
};
},
+ created() {
+ this.startProgress();
+ },
+
methods: {
resetZoom() {
const resetButton = document.querySelector('.highcharts-reset-zoom');
@@ -38,6 +49,13 @@ export default {
this.timeScale = period;
this.resetZoom();
},
+ startProgress() {
+ this.startLoader();
+ this.$root.$on('memory', (loading) => this.onLoading(loading));
+ },
+ onLoading(loading) {
+ loading ? this.startLoader() : this.endLoader();
+ },
},
};
</script>
diff --git a/src/views/_sila/Memory/Dynamic/MemoryTemp.vue b/src/views/_sila/Memory/Dynamic/MemoryTemp.vue
index 07798d6d..3fbf9da1 100644
--- a/src/views/_sila/Memory/Dynamic/MemoryTemp.vue
+++ b/src/views/_sila/Memory/Dynamic/MemoryTemp.vue
@@ -1,5 +1,5 @@
<template>
- <div>
+ <div :class="{ disabledDiv: loading }">
<b-col class="d-flex flex-nowrap align-items-center page-divider">
<img src="@/assets/images/_sila/collapsed/temperature.svg" />
{{ $t('pageMemory.temperature') }}
@@ -138,7 +138,7 @@ export default {
loading,
warning: null,
critical: null,
- isBusy: true,
+ isBusy: false,
fields: [
{
key: 'name',
@@ -270,16 +270,27 @@ export default {
payload = { lastHour: true };
}
- this.startLoader();
+ this.start();
this.$store.dispatch('memory/getMemoryDynamic', payload).finally(() => {
this.$store.dispatch('memory/getLimits').finally(() => {
this.warning = this.warningLimit;
this.critical = this.criticalLimit;
- this.endLoader();
- this.isBusy = false;
+ this.end();
});
});
},
+
+ start() {
+ this.startLoader();
+ this.isBusy = true;
+ this.$root.$emit('memory', true);
+ },
+
+ end() {
+ this.endLoader();
+ this.isBusy = false;
+ this.$root.$emit('memory', false);
+ },
},
};
</script>