Add last reset time to server power operations page

 - Timestamp is displayed to inform user of last
   power operation

Signed-off-by: Dixsie Wolmers <dixsie@ibm.com>
Change-Id: I14c23ff56b3a0cf134c0ad2d831290971d93e293
diff --git a/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue b/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue
index 41d8cf0..0db0129 100644
--- a/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue
+++ b/src/views/Control/ServerPowerOperations/ServerPowerOperations.vue
@@ -6,18 +6,36 @@
         <page-section
           :section-title="$t('pageServerPowerOperations.currentStatus')"
         >
-          <dl>
-            <dt>{{ $t('pageServerPowerOperations.hostStatus') }}</dt>
-            <dd v-if="hostStatus === 'on'">
-              {{ $t('global.status.on') }}
-            </dd>
-            <dd v-else-if="hostStatus === 'off'">
-              {{ $t('global.status.off') }}
-            </dd>
-            <dd v-else>
-              {{ $t('global.status.notAvailable') }}
-            </dd>
-          </dl>
+          <b-row>
+            <b-col>
+              <dl>
+                <dt>{{ $t('pageServerPowerOperations.hostStatus') }}</dt>
+                <dd v-if="hostStatus === 'on'">
+                  {{ $t('global.status.on') }}
+                </dd>
+                <dd v-else-if="hostStatus === 'off'">
+                  {{ $t('global.status.off') }}
+                </dd>
+                <dd v-else>
+                  {{ $t('global.status.notAvailable') }}
+                </dd>
+              </dl>
+            </b-col>
+          </b-row>
+          <b-row>
+            <b-col>
+              <dl>
+                <dt>
+                  {{ $t('pageServerPowerOperations.lastPowerOperation') }}
+                </dt>
+                <dd v-if="lastPowerOperationTime">
+                  {{ lastPowerOperationTime | formatDate }}
+                  {{ lastPowerOperationTime | formatTime }}
+                </dd>
+                <dd v-else>--</dd>
+              </dl>
+            </b-col>
+          </b-row>
         </page-section>
       </b-col>
     </b-row>
@@ -142,12 +160,24 @@
     isOperationInProgress() {
       return this.$store.getters['controls/isOperationInProgress'];
     },
+    lastPowerOperationTime() {
+      return this.$store.getters['controls/lastPowerOperationTime'];
+    },
     oneTimeBootEnabled() {
       return this.$store.getters['hostBootSettings/overrideEnabled'];
     }
   },
   created() {
     this.startLoader();
+    const bootSettingsPromise = new Promise(resolve => {
+      this.$root.$on('serverPowerOperations::bootSettings::complete', () =>
+        resolve()
+      );
+    });
+    Promise.all([
+      this.$store.dispatch('controls/getLastPowerOperationTime'),
+      bootSettingsPromise
+    ]).finally(() => this.endLoader());
   },
   beforeRouteLeave(to, from, next) {
     this.hideLoader();