Add last reset time to reboot bmc  page

- Timestamp is displayed to inform user of last
  power operation

Signed-off-by: Dixsie Wolmers <dixsie@ibm.com>
Change-Id: Ia4d95bced701b04f1099d020ee062f06d16ae8dc
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index cc99373..97f4578 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -496,6 +496,7 @@
     }
   },
   "pageRebootBmc": {
+    "lastReboot": "Last BMC reboot",
     "rebootBmc": "Reboot BMC",
     "rebootInformation": "When you reboot the BMC, your web browser loses contact with the BMC for several minutes. When the BMC is back online, you may need to log in again.",
     "modal": {
diff --git a/src/store/modules/Control/ControlStore.js b/src/store/modules/Control/ControlStore.js
index 6908769..f27f5a6 100644
--- a/src/store/modules/Control/ControlStore.js
+++ b/src/store/modules/Control/ControlStore.js
@@ -32,17 +32,21 @@
   namespaced: true,
   state: {
     isOperationInProgress: false,
-    lastPowerOperationTime: null
+    lastPowerOperationTime: null,
+    lastBmcRebootTime: null
   },
   getters: {
     isOperationInProgress: state => state.isOperationInProgress,
-    lastPowerOperationTime: state => state.lastPowerOperationTime
+    lastPowerOperationTime: state => state.lastPowerOperationTime,
+    lastBmcRebootTime: state => state.lastBmcRebootTime
   },
   mutations: {
     setOperationInProgress: (state, inProgress) =>
       (state.isOperationInProgress = inProgress),
     setLastPowerOperationTime: (state, lastPowerOperationTime) =>
-      (state.lastPowerOperationTime = lastPowerOperationTime)
+      (state.lastPowerOperationTime = lastPowerOperationTime),
+    setLastBmcRebootTime: (state, lastBmcRebootTime) =>
+      (state.lastBmcRebootTime = lastBmcRebootTime)
   },
   actions: {
     async getLastPowerOperationTime({ commit }) {
@@ -55,10 +59,21 @@
         })
         .catch(error => console.log(error));
     },
-    async rebootBmc() {
+    getLastBmcRebootTime({ commit }) {
+      return api
+        .get('/redfish/v1/Managers/bmc')
+        .then(response => {
+          const lastBmcReset = response.data.LastResetTime;
+          const lastBmcRebootTime = new Date(lastBmcReset);
+          commit('setLastBmcRebootTime', lastBmcRebootTime);
+        })
+        .catch(error => console.log(error));
+    },
+    async rebootBmc({ dispatch }) {
       const data = { ResetType: 'GracefulRestart' };
       return await api
         .post('/redfish/v1/Managers/bmc/Actions/Manager.Reset', data)
+        .then(() => dispatch('getLastBmcRebootTime'))
         .then(() => i18n.t('pageRebootBmc.toast.successRebootStart'))
         .catch(error => {
           console.log(error);
diff --git a/src/views/Control/RebootBmc/RebootBmc.vue b/src/views/Control/RebootBmc/RebootBmc.vue
index dbe1762..7bd9877 100644
--- a/src/views/Control/RebootBmc/RebootBmc.vue
+++ b/src/views/Control/RebootBmc/RebootBmc.vue
@@ -4,6 +4,20 @@
     <b-row>
       <b-col md="8" lg="8" xl="6">
         <page-section>
+          <b-row>
+            <b-col>
+              <dl>
+                <dt>
+                  {{ $t('pageRebootBmc.lastReboot') }}
+                </dt>
+                <dd v-if="lastBmcRebootTime">
+                  {{ lastBmcRebootTime | formatDate }}
+                  {{ lastBmcRebootTime | formatTime }}
+                </dd>
+                <dd v-else>--</dd>
+              </dl>
+            </b-col>
+          </b-row>
           {{ $t('pageRebootBmc.rebootInformation') }}
           <b-button
             variant="primary"
@@ -23,11 +37,23 @@
 import PageTitle from '../../../components/Global/PageTitle';
 import PageSection from '../../../components/Global/PageSection';
 import BVToastMixin from '../../../components/Mixins/BVToastMixin';
+import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
 
 export default {
   name: 'RebootBmc',
   components: { PageTitle, PageSection },
-  mixins: [BVToastMixin],
+  mixins: [BVToastMixin, LoadingBarMixin],
+  computed: {
+    lastBmcRebootTime() {
+      return this.$store.getters['controls/lastBmcRebootTime'];
+    }
+  },
+  created() {
+    this.startLoader();
+    this.$store
+      .dispatch('controls/getLastBmcRebootTime')
+      .finally(() => this.endLoader());
+  },
   methods: {
     onClick() {
       this.$bvModal