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 /> |
SurenNeware | dc3fa2e | 2020-08-04 20:45:25 +0530 | [diff] [blame] | 22 | |
| 23 | <!-- Processors table --> |
| 24 | <table-processors /> |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 25 | </b-container> |
| 26 | </template> |
| 27 | |
| 28 | <script> |
| 29 | import PageTitle from '@/components/Global/PageTitle'; |
| 30 | import TableSystem from './HardwareStatusTableStystem'; |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 31 | import TablePowerSupplies from './HardwareStatusTablePowerSupplies'; |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 32 | import TableDimmSlot from './HardwareStatusTableDimmSlot'; |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 33 | import TableFans from './HardwareStatusTableFans'; |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 34 | import TableBmcManager from './HardwareStatusTableBmcManager'; |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 35 | import TableChassis from './HardwareStatusTableChassis'; |
SurenNeware | dc3fa2e | 2020-08-04 20:45:25 +0530 | [diff] [blame] | 36 | import TableProcessors from './HardwareStatusTableProcessors'; |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 37 | import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; |
| 38 | |
| 39 | export default { |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 40 | components: { |
| 41 | PageTitle, |
| 42 | TableDimmSlot, |
| 43 | TablePowerSupplies, |
| 44 | TableSystem, |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 45 | TableFans, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 46 | TableBmcManager, |
SurenNeware | dc3fa2e | 2020-08-04 20:45:25 +0530 | [diff] [blame] | 47 | TableChassis, |
| 48 | TableProcessors |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 49 | }, |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 50 | mixins: [LoadingBarMixin], |
| 51 | created() { |
| 52 | this.startLoader(); |
| 53 | const systemTablePromise = new Promise(resolve => { |
| 54 | this.$root.$on('hardwareStatus::system::complete', () => resolve()); |
| 55 | }); |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 56 | const bmcManagerTablePromise = new Promise(resolve => { |
| 57 | this.$root.$on('hardwareStatus::bmcManager::complete', () => resolve()); |
| 58 | }); |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 59 | const chassisTablePromise = new Promise(resolve => { |
| 60 | this.$root.$on('hardwareStatus::chassis::complete', () => resolve()); |
| 61 | }); |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 62 | const dimmSlotTablePromise = new Promise(resolve => { |
| 63 | this.$root.$on('hardwareStatus::dimmSlot::complete', () => resolve()); |
| 64 | }); |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 65 | const fansTablePromise = new Promise(resolve => { |
| 66 | this.$root.$on('hardwareStatus::fans::complete', () => resolve()); |
| 67 | }); |
Yoshie Muranaka | 5918b48 | 2020-06-08 08:18:23 -0700 | [diff] [blame] | 68 | const powerSuppliesTablePromise = new Promise(resolve => { |
| 69 | this.$root.$on('hardwareStatus::powerSupplies::complete', () => |
| 70 | resolve() |
| 71 | ); |
| 72 | }); |
SurenNeware | dc3fa2e | 2020-08-04 20:45:25 +0530 | [diff] [blame] | 73 | const processorsTablePromise = new Promise(resolve => { |
| 74 | this.$root.$on('hardwareStatus::processors::complete', () => resolve()); |
| 75 | }); |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 76 | // Combine all child component Promises to indicate |
| 77 | // when page data load complete |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 78 | Promise.all([ |
| 79 | systemTablePromise, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 80 | bmcManagerTablePromise, |
Yoshie Muranaka | 09e8b5d | 2020-06-08 07:36:59 -0700 | [diff] [blame] | 81 | chassisTablePromise, |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 82 | dimmSlotTablePromise, |
Yoshie Muranaka | b89a53c | 2020-06-15 13:25:46 -0700 | [diff] [blame] | 83 | fansTablePromise, |
SurenNeware | dc3fa2e | 2020-08-04 20:45:25 +0530 | [diff] [blame] | 84 | powerSuppliesTablePromise, |
| 85 | processorsTablePromise |
Yoshie Muranaka | e24b17d | 2020-06-08 11:03:11 -0700 | [diff] [blame] | 86 | ]).finally(() => this.endLoader()); |
Yoshie Muranaka | 56ee769 | 2020-05-28 13:28:29 -0700 | [diff] [blame] | 87 | }, |
| 88 | beforeRouteLeave(to, from, next) { |
| 89 | // Hide loader if user navigates away from page |
| 90 | // before requests complete |
| 91 | this.hideLoader(); |
| 92 | next(); |
| 93 | } |
| 94 | }; |
| 95 | </script> |