blob: c104ea33223ab1e081fe9ef209c111e4ea5c9245 [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 Muranakae24b17d2020-06-08 11:03:11 -07008 <!-- DIMM slot table -->
9 <table-dimm-slot />
10
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070011 <!-- Fans table -->
12 <table-fans />
13
Yoshie Muranaka5918b482020-06-08 08:18:23 -070014 <!-- Power supplies table -->
15 <table-power-supplies />
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070016 </b-container>
17</template>
18
19<script>
20import PageTitle from '@/components/Global/PageTitle';
21import TableSystem from './HardwareStatusTableStystem';
Yoshie Muranaka5918b482020-06-08 08:18:23 -070022import TablePowerSupplies from './HardwareStatusTablePowerSupplies';
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070023import TableDimmSlot from './HardwareStatusTableDimmSlot';
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070024import TableFans from './HardwareStatusTableFans';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070025import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
26
27export default {
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070028 components: {
29 PageTitle,
30 TableDimmSlot,
31 TablePowerSupplies,
32 TableSystem,
33 TableFans
34 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070035 mixins: [LoadingBarMixin],
36 created() {
37 this.startLoader();
38 const systemTablePromise = new Promise(resolve => {
39 this.$root.$on('hardwareStatus::system::complete', () => resolve());
40 });
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070041 const dimmSlotTablePromise = new Promise(resolve => {
42 this.$root.$on('hardwareStatus::dimmSlot::complete', () => resolve());
43 });
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070044 const fansTablePromise = new Promise(resolve => {
45 this.$root.$on('hardwareStatus::fans::complete', () => resolve());
46 });
Yoshie Muranaka5918b482020-06-08 08:18:23 -070047 const powerSuppliesTablePromise = new Promise(resolve => {
48 this.$root.$on('hardwareStatus::powerSupplies::complete', () =>
49 resolve()
50 );
51 });
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070052 // Combine all child component Promises to indicate
53 // when page data load complete
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070054 Promise.all([
55 systemTablePromise,
56 dimmSlotTablePromise,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070057 fansTablePromise,
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070058 powerSuppliesTablePromise
59 ]).finally(() => this.endLoader());
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070060 },
61 beforeRouteLeave(to, from, next) {
62 // Hide loader if user navigates away from page
63 // before requests complete
64 this.hideLoader();
65 next();
66 }
67};
68</script>