blob: 364baad22877d313295697f1f3c0ed2d372cd0d1 [file] [log] [blame]
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07001<template>
2 <b-container fluid="xl">
3 <page-title />
4
5 <!-- System table -->
6 <table-system />
Yoshie Muranaka5918b482020-06-08 08:18:23 -07007
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -07008 <!-- BMC manager table -->
9 <table-bmc-manager />
10
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070011 <!-- Chassis table -->
12 <table-chassis />
13
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070014 <!-- DIMM slot table -->
15 <table-dimm-slot />
16
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070017 <!-- Fans table -->
18 <table-fans />
19
Yoshie Muranaka5918b482020-06-08 08:18:23 -070020 <!-- Power supplies table -->
21 <table-power-supplies />
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070022 </b-container>
23</template>
24
25<script>
26import PageTitle from '@/components/Global/PageTitle';
27import TableSystem from './HardwareStatusTableStystem';
Yoshie Muranaka5918b482020-06-08 08:18:23 -070028import TablePowerSupplies from './HardwareStatusTablePowerSupplies';
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070029import TableDimmSlot from './HardwareStatusTableDimmSlot';
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070030import TableFans from './HardwareStatusTableFans';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070031import TableBmcManager from './HardwareStatusTableBmcManager';
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070032import TableChassis from './HardwareStatusTableChassis';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070033import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
34
35export default {
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070036 components: {
37 PageTitle,
38 TableDimmSlot,
39 TablePowerSupplies,
40 TableSystem,
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070041 TableFans,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070042 TableBmcManager,
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070043 TableChassis
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070044 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070045 mixins: [LoadingBarMixin],
46 created() {
47 this.startLoader();
48 const systemTablePromise = new Promise(resolve => {
49 this.$root.$on('hardwareStatus::system::complete', () => resolve());
50 });
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070051 const bmcManagerTablePromise = new Promise(resolve => {
52 this.$root.$on('hardwareStatus::bmcManager::complete', () => resolve());
53 });
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070054 const chassisTablePromise = new Promise(resolve => {
55 this.$root.$on('hardwareStatus::chassis::complete', () => resolve());
56 });
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070057 const dimmSlotTablePromise = new Promise(resolve => {
58 this.$root.$on('hardwareStatus::dimmSlot::complete', () => resolve());
59 });
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070060 const fansTablePromise = new Promise(resolve => {
61 this.$root.$on('hardwareStatus::fans::complete', () => resolve());
62 });
Yoshie Muranaka5918b482020-06-08 08:18:23 -070063 const powerSuppliesTablePromise = new Promise(resolve => {
64 this.$root.$on('hardwareStatus::powerSupplies::complete', () =>
65 resolve()
66 );
67 });
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070068 // Combine all child component Promises to indicate
69 // when page data load complete
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070070 Promise.all([
71 systemTablePromise,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070072 bmcManagerTablePromise,
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070073 chassisTablePromise,
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070074 dimmSlotTablePromise,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070075 fansTablePromise,
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070076 powerSuppliesTablePromise
77 ]).finally(() => this.endLoader());
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070078 },
79 beforeRouteLeave(to, from, next) {
80 // Hide loader if user navigates away from page
81 // before requests complete
82 this.hideLoader();
83 next();
84 }
85};
86</script>