From 5c977976d9450b50faeb33ba5bd1b5deaabcc3b5 Mon Sep 17 00:00:00 2001
From: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Date: Thu, 30 Apr 2020 09:48:23 -0700
Subject: Add loading bar to Server power operations page

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I823279c6865fa1ecff2f0443d735477e03fbf417
---
 src/views/Control/ServerPowerOperations/BootSettings.vue | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/views/Control/ServerPowerOperations/BootSettings.vue')

diff --git a/src/views/Control/ServerPowerOperations/BootSettings.vue b/src/views/Control/ServerPowerOperations/BootSettings.vue
index 0558a1b4a..16d567a71 100644
--- a/src/views/Control/ServerPowerOperations/BootSettings.vue
+++ b/src/views/Control/ServerPowerOperations/BootSettings.vue
@@ -60,10 +60,11 @@
 <script>
 import { mapState } from 'vuex';
 import BVToastMixin from '../../../components/Mixins/BVToastMixin';
+import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
 
 export default {
   name: 'BootSettings',
-  mixins: [BVToastMixin],
+  mixins: [BVToastMixin, LoadingBarMixin],
   data() {
     return {
       form: {
@@ -102,11 +103,14 @@ export default {
     }
   },
   created() {
-    this.$store.dispatch('hostBootSettings/getBootSettings');
-    this.$store.dispatch('hostBootSettings/getTpmPolicy');
+    Promise.all([
+      this.$store.dispatch('hostBootSettings/getBootSettings'),
+      this.$store.dispatch('hostBootSettings/getTpmPolicy')
+    ]).finally(() => this.endLoader());
   },
   methods: {
     handleSubmit() {
+      this.startLoader();
       const bootSettingsChanged =
         this.$v.form.bootOption.$dirty || this.$v.form.oneTimeBoot.$dirty;
       const tpmPolicyChanged = this.$v.form.tpmPolicyOn.$dirty;
@@ -130,6 +134,7 @@ export default {
         .catch(({ message }) => this.errorToast(message))
         .finally(() => {
           this.$v.form.$reset();
+          this.endLoader();
         });
     },
     onChangeSelect(selectedOption) {
-- 
cgit v1.2.3

