From c687f101324f301de04e326b2937953a395a5fed Mon Sep 17 00:00:00 2001
From: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Date: Tue, 2 Jun 2020 12:01:27 -0700
Subject: Refactor Overview page

Use SystemStore to get Server information values on the
overview page. Added missing properties to SystemStore
and removed hostFirmware from FirmwareStore.

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I5923adb0345f0de28f9a66f460e41d15f87f743a
---
 src/views/Overview/Overview.vue | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

(limited to 'src/views/Overview/Overview.vue')

diff --git a/src/views/Overview/Overview.vue b/src/views/Overview/Overview.vue
index 59b5063d..fa7f5242 100644
--- a/src/views/Overview/Overview.vue
+++ b/src/views/Overview/Overview.vue
@@ -105,13 +105,22 @@ export default {
   },
   mixins: [LoadingBarMixin],
   computed: mapState({
-    serverModel: state => state.overview.serverModel,
-    serverManufacturer: state => state.overview.serverManufacturer,
-    serverSerialNumber: state => state.overview.serverSerialNumber,
-    hostFirmwareVersion: state => state.firmware.hostFirmwareVersion,
+    server: state => state.system.systems[0],
     bmcFirmwareVersion: state => state.firmware.bmcFirmwareVersion,
     powerCapValue: state => state.powerControl.powerCapValue,
-    powerConsumptionValue: state => state.powerControl.powerConsumptionValue
+    powerConsumptionValue: state => state.powerControl.powerConsumptionValue,
+    serverManufacturer() {
+      return this.server ? this.server.manufacturer : '--';
+    },
+    serverModel() {
+      return this.server ? this.server.model : '--';
+    },
+    serverSerialNumber() {
+      return this.server ? this.server.serialNumber : '--';
+    },
+    hostFirmwareVersion() {
+      return this.server ? this.server.firmwareVersion : '--';
+    }
   }),
   created() {
     this.startLoader();
@@ -125,9 +134,8 @@ export default {
       this.$root.$on('overview::events::complete', () => resolve());
     });
     Promise.all([
-      this.$store.dispatch('overview/getServerInfo'),
+      this.$store.dispatch('system/getSystem'),
       this.$store.dispatch('firmware/getBmcFirmware'),
-      this.$store.dispatch('firmware/getHostFirmware'),
       this.$store.dispatch('powerControl/getPowerControl'),
       quicklinksPromise,
       networkPromise,
-- 
cgit v1.2.3

