From 5918b48a0530a43a4dd9ee1a3f134846c948011e Mon Sep 17 00:00:00 2001
From: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Date: Mon, 8 Jun 2020 08:18:23 -0700
Subject: Add power supplies table to hardware status page

Adds items at /redfish/v1/Chassis/chassis/Power endpoint in
Power supplies table. Table is sortable and has a row expansion
to view details.

- Table sort mixin to reuse sort method for status values

Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Ib2953ad06be3fa25e9dbbbed34e37d09154431f5
---
 src/views/Health/HardwareStatus/HardwareStatus.vue | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

(limited to 'src/views/Health/HardwareStatus/HardwareStatus.vue')

diff --git a/src/views/Health/HardwareStatus/HardwareStatus.vue b/src/views/Health/HardwareStatus/HardwareStatus.vue
index 9f34b534..2860e599 100644
--- a/src/views/Health/HardwareStatus/HardwareStatus.vue
+++ b/src/views/Health/HardwareStatus/HardwareStatus.vue
@@ -4,25 +4,36 @@
 
     <!-- System table -->
     <table-system />
+
+    <!-- Power supplies table -->
+    <table-power-supplies />
   </b-container>
 </template>
 
 <script>
 import PageTitle from '@/components/Global/PageTitle';
 import TableSystem from './HardwareStatusTableStystem';
+import TablePowerSupplies from './HardwareStatusTablePowerSupplies';
 import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
 
 export default {
-  components: { PageTitle, TableSystem },
+  components: { PageTitle, TablePowerSupplies, TableSystem },
   mixins: [LoadingBarMixin],
   created() {
     this.startLoader();
     const systemTablePromise = new Promise(resolve => {
       this.$root.$on('hardwareStatus::system::complete', () => resolve());
     });
+    const powerSuppliesTablePromise = new Promise(resolve => {
+      this.$root.$on('hardwareStatus::powerSupplies::complete', () =>
+        resolve()
+      );
+    });
     // Combine all child component Promises to indicate
     // when page data load complete
-    Promise.all([systemTablePromise]).finally(() => this.endLoader());
+    Promise.all([systemTablePromise, powerSuppliesTablePromise]).finally(() =>
+      this.endLoader()
+    );
   },
   beforeRouteLeave(to, from, next) {
     // Hide loader if user navigates away from page
-- 
cgit v1.2.3

