From 50ff183844ecd16163b9f449fbcf14366b0c6442 Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Fri, 1 May 2020 11:00:17 -0700 Subject: Add loading bar to Sensors page Signed-off-by: Yoshie Muranaka Change-Id: I6d44e1326b2cf697bf1f20e4e10ccd68e4681c66 --- src/views/Health/Sensors/Sensors.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/views') diff --git a/src/views/Health/Sensors/Sensors.vue b/src/views/Health/Sensors/Sensors.vue index 6de5c9e7..6cd70be8 100644 --- a/src/views/Health/Sensors/Sensors.vue +++ b/src/views/Health/Sensors/Sensors.vue @@ -83,6 +83,7 @@ import TableToolbarExport from '@/components/Global/TableToolbarExport'; import TableFilterMixin from '../../../components/Mixins/TableFilterMixin'; import BVTableSelectableMixin from '@/components/Mixins/BVTableSelectableMixin'; +import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; const SENSOR_STATUS = ['OK', 'Warning', 'Critical']; @@ -102,7 +103,7 @@ export default { TableToolbar, TableToolbarExport }, - mixins: [TableFilterMixin, BVTableSelectableMixin], + mixins: [TableFilterMixin, BVTableSelectableMixin, LoadingBarMixin], data() { return { fields: [ @@ -171,7 +172,14 @@ export default { } }, created() { - this.$store.dispatch('sensors/getAllSensors'); + this.startLoader(); + this.$store + .dispatch('sensors/getAllSensors') + .finally(() => this.endLoader()); + }, + beforeRouteLeave(to, from, next) { + this.hideLoader(); + next(); }, methods: { statusIcon(status) { -- cgit v1.2.3