Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 1 | <template> |
| 2 | <b-container fluid="xl"> |
| 3 | <page-title /> |
| 4 | |
| 5 | <!-- System table --> |
| 6 | <table-system /> |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 7 | |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 8 | <!-- DIMM slot table --> |
| 9 | <table-dimm-slot /> |
| 10 | |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame^] | 11 | <!-- Fans table --> |
| 12 | <table-fans /> |
| 13 | |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 14 | <!-- Power supplies table --> |
| 15 | <table-power-supplies /> |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 16 | </b-container> |
| 17 | </template> |
| 18 | |
| 19 | <script> |
| 20 | import PageTitle from '@/components/Global/PageTitle'; |
| 21 | import TableSystem from './HardwareStatusTableStystem'; |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 22 | import TablePowerSupplies from './HardwareStatusTablePowerSupplies'; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 23 | import TableDimmSlot from './HardwareStatusTableDimmSlot'; |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame^] | 24 | import TableFans from './HardwareStatusTableFans'; |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 25 | import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; |
| 26 | |
| 27 | export default { |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame^] | 28 | components: { |
| 29 | PageTitle, |
| 30 | TableDimmSlot, |
| 31 | TablePowerSupplies, |
| 32 | TableSystem, |
| 33 | TableFans |
| 34 | }, |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 35 | mixins: [LoadingBarMixin], |
| 36 | created() { |
| 37 | this.startLoader(); |
| 38 | const systemTablePromise = new Promise(resolve => { |
| 39 | this.$root.$on('hardwareStatus::system::complete', () => resolve()); |
| 40 | }); |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 41 | const dimmSlotTablePromise = new Promise(resolve => { |
| 42 | this.$root.$on('hardwareStatus::dimmSlot::complete', () => resolve()); |
| 43 | }); |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame^] | 44 | const fansTablePromise = new Promise(resolve => { |
| 45 | this.$root.$on('hardwareStatus::fans::complete', () => resolve()); |
| 46 | }); |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 47 | const powerSuppliesTablePromise = new Promise(resolve => { |
| 48 | this.$root.$on('hardwareStatus::powerSupplies::complete', () => |
| 49 | resolve() |
| 50 | ); |
| 51 | }); |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 52 | // Combine all child component Promises to indicate |
| 53 | // when page data load complete |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 54 | Promise.all([ |
| 55 | systemTablePromise, |
| 56 | dimmSlotTablePromise, |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame^] | 57 | fansTablePromise, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 58 | powerSuppliesTablePromise |
| 59 | ]).finally(() => this.endLoader()); |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 60 | }, |
| 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> |