diff options
Diffstat (limited to 'src/views/_sila')
-rw-r--r-- | src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue | 22 | ||||
-rw-r--r-- | src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue | 21 |
2 files changed, 36 insertions, 7 deletions
diff --git a/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue b/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue index c5562f2b..0f92b5cd 100644 --- a/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.vue +++ b/src/views/_sila/Motherboard/Dynamic/MotherboardDynamicPage.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" + /> <motherboard-temp :time-scale="timeScale"></motherboard-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 MotherboardTemp from './MotherboardTemp'; @@ -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('motherboard', (loading) => this.onLoading(loading)); + }, + onLoading(loading) { + loading ? this.startLoader() : this.endLoader(); + }, }, }; </script> diff --git a/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue b/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue index 6994082d..0a6d2c3e 100644 --- a/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.vue +++ b/src/views/_sila/Motherboard/Dynamic/MotherboardTemp.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('pageMotherboard.temperature') }} @@ -117,7 +117,7 @@ export default { return { loading, warning: null, - isBusy: true, + isBusy: false, fields: [ { key: 'name', @@ -237,17 +237,28 @@ export default { payload = { lastHour: true }; } - this.startLoader(); + this.start(); this.$store .dispatch('motherboard/getMotherboardDynamic', payload) .finally(() => { this.$store.dispatch('motherboard/getLimits').finally(() => { this.warning = this.warningLimit; - this.endLoader(); - this.isBusy = false; + this.end(); }); }); }, + + start() { + this.startLoader(); + this.isBusy = true; + this.$root.$emit('motherboard', true); + }, + + end() { + this.endLoader(); + this.isBusy = false; + this.$root.$emit('motherboard', false); + }, }, }; </script> |