diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-05-01 21:00:17 +0300 |
---|---|---|
committer | Derick Montague <derick.montague@ibm.com> | 2020-05-06 00:07:02 +0300 |
commit | 50ff183844ecd16163b9f449fbcf14366b0c6442 (patch) | |
tree | 1fd56f241545b65cdbf01827ab2d6d6de6f7da8b /src/views/Health/Sensors/Sensors.vue | |
parent | 598bf7e96704f54400ec1730255168dd4d274218 (diff) | |
download | webui-vue-50ff183844ecd16163b9f449fbcf14366b0c6442.tar.xz |
Add loading bar to Sensors page
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I6d44e1326b2cf697bf1f20e4e10ccd68e4681c66
Diffstat (limited to 'src/views/Health/Sensors/Sensors.vue')
-rw-r--r-- | src/views/Health/Sensors/Sensors.vue | 12 |
1 files changed, 10 insertions, 2 deletions
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) { |