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 | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame^] | 8 | <!-- BMC manager table --> |
| 9 | <table-bmc-manager /> |
| 10 | |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 11 | <!-- Chassis table --> |
| 12 | <table-chassis /> |
| 13 | |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 14 | <!-- DIMM slot table --> |
| 15 | <table-dimm-slot /> |
| 16 | |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 17 | <!-- Fans table --> |
| 18 | <table-fans /> |
| 19 | |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 20 | <!-- Power supplies table --> |
| 21 | <table-power-supplies /> |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 22 | </b-container> |
| 23 | </template> |
| 24 | |
| 25 | <script> |
| 26 | import PageTitle from '@/components/Global/PageTitle'; |
| 27 | import TableSystem from './HardwareStatusTableStystem'; |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 28 | import TablePowerSupplies from './HardwareStatusTablePowerSupplies'; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 29 | import TableDimmSlot from './HardwareStatusTableDimmSlot'; |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 30 | import TableFans from './HardwareStatusTableFans'; |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame^] | 31 | import TableBmcManager from './HardwareStatusTableBmcManager'; |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 32 | import TableChassis from './HardwareStatusTableChassis'; |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 33 | import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; |
| 34 | |
| 35 | export default { |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 36 | components: { |
| 37 | PageTitle, |
| 38 | TableDimmSlot, |
| 39 | TablePowerSupplies, |
| 40 | TableSystem, |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 41 | TableFans, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame^] | 42 | TableBmcManager, |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 43 | TableChassis |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 44 | }, |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 45 | mixins: [LoadingBarMixin], |
| 46 | created() { |
| 47 | this.startLoader(); |
| 48 | const systemTablePromise = new Promise(resolve => { |
| 49 | this.$root.$on('hardwareStatus::system::complete', () => resolve()); |
| 50 | }); |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame^] | 51 | const bmcManagerTablePromise = new Promise(resolve => { |
| 52 | this.$root.$on('hardwareStatus::bmcManager::complete', () => resolve()); |
| 53 | }); |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 54 | const chassisTablePromise = new Promise(resolve => { |
| 55 | this.$root.$on('hardwareStatus::chassis::complete', () => resolve()); |
| 56 | }); |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 57 | const dimmSlotTablePromise = new Promise(resolve => { |
| 58 | this.$root.$on('hardwareStatus::dimmSlot::complete', () => resolve()); |
| 59 | }); |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 60 | const fansTablePromise = new Promise(resolve => { |
| 61 | this.$root.$on('hardwareStatus::fans::complete', () => resolve()); |
| 62 | }); |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 63 | const powerSuppliesTablePromise = new Promise(resolve => { |
| 64 | this.$root.$on('hardwareStatus::powerSupplies::complete', () => |
| 65 | resolve() |
| 66 | ); |
| 67 | }); |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 68 | // Combine all child component Promises to indicate |
| 69 | // when page data load complete |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 70 | Promise.all([ |
| 71 | systemTablePromise, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame^] | 72 | bmcManagerTablePromise, |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 73 | chassisTablePromise, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 74 | dimmSlotTablePromise, |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 75 | fansTablePromise, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 76 | powerSuppliesTablePromise |
| 77 | ]).finally(() => this.endLoader()); |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 78 | }, |
| 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> |