blob: fcdbf8d22dd4ce6f740739c5d5f0300eb8a0c0e9 [file] [log] [blame]
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07001<template>
2 <b-container fluid="xl">
3 <page-title />
4
Sukanya Pandey05388962021-06-10 15:35:21 +05305 <!-- Service indicators -->
6 <service-indicator />
7
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -05008 <!-- Quicklinks section -->
Sandeepa Singh7affc522021-07-06 16:29:10 +05309 <page-section :section-title="$t('pageInventory.quicklinkTitle')">
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050010 <b-row class="w-75">
11 <b-col v-for="column in quicklinkColumns" :key="column.id" xl="4">
12 <div v-for="item in column" :key="item.id">
13 <b-link
14 :href="item.href"
15 :data-ref="item.dataRef"
16 @click.prevent="scrollToOffset"
17 >
18 <jump-link /> {{ item.linkText }}
19 </b-link>
20 </div>
21 </b-col>
22 </b-row>
23 </page-section>
24
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070025 <!-- System table -->
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050026 <table-system ref="system" />
Yoshie Muranaka5918b482020-06-08 08:18:23 -070027
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070028 <!-- BMC manager table -->
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050029 <table-bmc-manager ref="bmc" />
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070030
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070031 <!-- Chassis table -->
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050032 <table-chassis ref="chassis" />
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070033
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070034 <!-- DIMM slot table -->
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050035 <table-dimm-slot ref="dimms" />
Yoshie Muranakae24b17d2020-06-08 11:03:11 -070036
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070037 <!-- Fans table -->
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050038 <table-fans ref="fans" />
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070039
Yoshie Muranaka5918b482020-06-08 08:18:23 -070040 <!-- Power supplies table -->
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050041 <table-power-supplies ref="powerSupply" />
SurenNewaredc3fa2e2020-08-04 20:45:25 +053042
43 <!-- Processors table -->
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050044 <table-processors ref="processors" />
Sneha Patela02c6f92021-09-09 12:40:38 -050045
46 <!-- Assembly table -->
47 <table-assembly ref="assembly" />
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070048 </b-container>
49</template>
50
51<script>
52import PageTitle from '@/components/Global/PageTitle';
Sukanya Pandey05388962021-06-10 15:35:21 +053053import ServiceIndicator from './InventoryServiceIndicator';
Sandeepa Singh7affc522021-07-06 16:29:10 +053054import TableSystem from './InventoryTableSystem';
55import TablePowerSupplies from './InventoryTablePowerSupplies';
56import TableDimmSlot from './InventoryTableDimmSlot';
57import TableFans from './InventoryTableFans';
58import TableBmcManager from './InventoryTableBmcManager';
59import TableChassis from './InventoryTableChassis';
60import TableProcessors from './InventoryTableProcessors';
Sneha Patela02c6f92021-09-09 12:40:38 -050061import TableAssembly from './InventoryTableAssembly';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070062import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050063import PageSection from '@/components/Global/PageSection';
64import JumpLink16 from '@carbon/icons-vue/es/jump-link/16';
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050065import JumpLinkMixin from '@/components/Mixins/JumpLinkMixin';
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050066import { chunk } from 'lodash';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070067
68export default {
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070069 components: {
70 PageTitle,
Sukanya Pandey05388962021-06-10 15:35:21 +053071 ServiceIndicator,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070072 TableDimmSlot,
73 TablePowerSupplies,
74 TableSystem,
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070075 TableFans,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070076 TableBmcManager,
SurenNewaredc3fa2e2020-08-04 20:45:25 +053077 TableChassis,
Derick Montague602e98a2020-10-21 16:20:00 -050078 TableProcessors,
Sneha Patela02c6f92021-09-09 12:40:38 -050079 TableAssembly,
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050080 PageSection,
81 JumpLink: JumpLink16,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070082 },
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050083 mixins: [LoadingBarMixin, JumpLinkMixin],
Derick Montague602e98a2020-10-21 16:20:00 -050084 beforeRouteLeave(to, from, next) {
85 // Hide loader if user navigates away from page
86 // before requests complete
87 this.hideLoader();
88 next();
89 },
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050090 data() {
91 return {
92 links: [
93 {
Dixsie Wolmers0a7a4992021-06-25 08:18:23 -050094 id: 'system',
95 dataRef: 'system',
96 href: '#system',
Sandeepa Singh7affc522021-07-06 16:29:10 +053097 linkText: this.$t('pageInventory.system'),
Dixsie Wolmers0a7a4992021-06-25 08:18:23 -050098 },
99 {
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500100 id: 'bmc',
101 dataRef: 'bmc',
102 href: '#bmc',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530103 linkText: this.$t('pageInventory.bmcManager'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500104 },
105 {
106 id: 'chassis',
107 dataRef: 'chassis',
108 href: '#chassis',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530109 linkText: this.$t('pageInventory.chassis'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500110 },
111 {
112 id: 'dimms',
113 dataRef: 'dimms',
114 href: '#dimms',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530115 linkText: this.$t('pageInventory.dimmSlot'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500116 },
117 {
118 id: 'fans',
119 dataRef: 'fans',
120 href: '#fans',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530121 linkText: this.$t('pageInventory.fans'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500122 },
123 {
124 id: 'powerSupply',
125 dataRef: 'powerSupply',
126 href: '#powerSupply',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530127 linkText: this.$t('pageInventory.powerSupplies'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500128 },
129 {
130 id: 'processors',
131 dataRef: 'processors',
132 href: '#processors',
Sandeepa Singh7affc522021-07-06 16:29:10 +0530133 linkText: this.$t('pageInventory.processors'),
134 },
135 {
Sneha Patela02c6f92021-09-09 12:40:38 -0500136 id: 'assembly',
137 dataRef: 'assembly',
138 href: '#assembly',
139 linkText: this.$t('pageInventory.assemblies'),
140 },
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500141 ],
142 };
143 },
144 computed: {
145 quicklinkColumns() {
146 // Chunk links array to 3 array's to display 3 items per column
147 return chunk(this.links, 3);
148 },
149 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700150 created() {
151 this.startLoader();
Derick Montague602e98a2020-10-21 16:20:00 -0500152 const bmcManagerTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530153 this.$root.$on('hardware-status-bmc-manager-complete', () => resolve());
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700154 });
Derick Montague602e98a2020-10-21 16:20:00 -0500155 const chassisTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530156 this.$root.$on('hardware-status-chassis-complete', () => resolve());
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -0700157 });
Derick Montague602e98a2020-10-21 16:20:00 -0500158 const dimmSlotTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530159 this.$root.$on('hardware-status-dimm-slot-complete', () => resolve());
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700160 });
Derick Montague602e98a2020-10-21 16:20:00 -0500161 const fansTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530162 this.$root.$on('hardware-status-fans-complete', () => resolve());
Yoshie Muranakab89a53c2020-06-15 13:25:46 -0700163 });
Derick Montague602e98a2020-10-21 16:20:00 -0500164 const powerSuppliesTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530165 this.$root.$on('hardware-status-power-supplies-complete', () =>
Yoshie Muranaka5918b482020-06-08 08:18:23 -0700166 resolve()
167 );
168 });
Derick Montague602e98a2020-10-21 16:20:00 -0500169 const processorsTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530170 this.$root.$on('hardware-status-processors-complete', () => resolve());
SurenNewaredc3fa2e2020-08-04 20:45:25 +0530171 });
Sukanya Pandey05388962021-06-10 15:35:21 +0530172 const serviceIndicatorPromise = new Promise((resolve) => {
173 this.$root.$on('hardware-status-service-complete', () => resolve());
174 });
175 const systemTablePromise = new Promise((resolve) => {
176 this.$root.$on('hardware-status-system-complete', () => resolve());
177 });
Sneha Patela02c6f92021-09-09 12:40:38 -0500178 const assemblyTablePromise = new Promise((resolve) => {
179 this.$root.$on('hardware-status-assembly-complete', () => resolve());
180 });
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700181 // Combine all child component Promises to indicate
182 // when page data load complete
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700183 Promise.all([
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700184 bmcManagerTablePromise,
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -0700185 chassisTablePromise,
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700186 dimmSlotTablePromise,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -0700187 fansTablePromise,
SurenNewaredc3fa2e2020-08-04 20:45:25 +0530188 powerSuppliesTablePromise,
Derick Montague602e98a2020-10-21 16:20:00 -0500189 processorsTablePromise,
Sukanya Pandey05388962021-06-10 15:35:21 +0530190 serviceIndicatorPromise,
191 systemTablePromise,
Sneha Patela02c6f92021-09-09 12:40:38 -0500192 assemblyTablePromise,
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700193 ]).finally(() => this.endLoader());
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700194 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700195};
196</script>