blob: a3f4d23edbb605362fc3bfaf2899b683778f4538 [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';
Surya Vde23ea22024-07-11 15:19:46 +053067import { useI18n } from 'vue-i18n';
68import i18n from '@/i18n';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070069
70export default {
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070071 components: {
72 PageTitle,
Sukanya Pandey05388962021-06-10 15:35:21 +053073 ServiceIndicator,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070074 TableDimmSlot,
75 TablePowerSupplies,
76 TableSystem,
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -070077 TableFans,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070078 TableBmcManager,
SurenNewaredc3fa2e2020-08-04 20:45:25 +053079 TableChassis,
Derick Montague602e98a2020-10-21 16:20:00 -050080 TableProcessors,
Sneha Patela02c6f92021-09-09 12:40:38 -050081 TableAssembly,
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050082 PageSection,
83 JumpLink: JumpLink16,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -070084 },
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050085 mixins: [LoadingBarMixin, JumpLinkMixin],
Derick Montague602e98a2020-10-21 16:20:00 -050086 beforeRouteLeave(to, from, next) {
87 // Hide loader if user navigates away from page
88 // before requests complete
89 this.hideLoader();
90 next();
91 },
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050092 data() {
93 return {
Surya Vde23ea22024-07-11 15:19:46 +053094 $t: useI18n().t,
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -050095 links: [
96 {
Dixsie Wolmers0a7a4992021-06-25 08:18:23 -050097 id: 'system',
98 dataRef: 'system',
99 href: '#system',
Surya Vde23ea22024-07-11 15:19:46 +0530100 linkText: i18n.global.t('pageInventory.system'),
Dixsie Wolmers0a7a4992021-06-25 08:18:23 -0500101 },
102 {
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500103 id: 'bmc',
104 dataRef: 'bmc',
105 href: '#bmc',
Surya Vde23ea22024-07-11 15:19:46 +0530106 linkText: i18n.global.t('pageInventory.bmcManager'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500107 },
108 {
109 id: 'chassis',
110 dataRef: 'chassis',
111 href: '#chassis',
Surya Vde23ea22024-07-11 15:19:46 +0530112 linkText: i18n.global.t('pageInventory.chassis'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500113 },
114 {
115 id: 'dimms',
116 dataRef: 'dimms',
117 href: '#dimms',
Surya Vde23ea22024-07-11 15:19:46 +0530118 linkText: i18n.global.t('pageInventory.dimmSlot'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500119 },
120 {
121 id: 'fans',
122 dataRef: 'fans',
123 href: '#fans',
Surya Vde23ea22024-07-11 15:19:46 +0530124 linkText: i18n.global.t('pageInventory.fans'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500125 },
126 {
127 id: 'powerSupply',
128 dataRef: 'powerSupply',
129 href: '#powerSupply',
Surya Vde23ea22024-07-11 15:19:46 +0530130 linkText: i18n.global.t('pageInventory.powerSupplies'),
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500131 },
132 {
133 id: 'processors',
134 dataRef: 'processors',
135 href: '#processors',
Surya Vde23ea22024-07-11 15:19:46 +0530136 linkText: i18n.global.t('pageInventory.processors'),
Sandeepa Singh7affc522021-07-06 16:29:10 +0530137 },
138 {
Sneha Patela02c6f92021-09-09 12:40:38 -0500139 id: 'assembly',
140 dataRef: 'assembly',
141 href: '#assembly',
Surya Vde23ea22024-07-11 15:19:46 +0530142 linkText: i18n.global.t('pageInventory.assemblies'),
Sneha Patela02c6f92021-09-09 12:40:38 -0500143 },
Dixsie Wolmersdc6b3cd2021-05-20 19:01:42 -0500144 ],
145 };
146 },
147 computed: {
148 quicklinkColumns() {
149 // Chunk links array to 3 array's to display 3 items per column
150 return chunk(this.links, 3);
151 },
152 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700153 created() {
154 this.startLoader();
Derick Montague602e98a2020-10-21 16:20:00 -0500155 const bmcManagerTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530156 this.$root.$on('hardware-status-bmc-manager-complete', () => resolve());
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700157 });
Derick Montague602e98a2020-10-21 16:20:00 -0500158 const chassisTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530159 this.$root.$on('hardware-status-chassis-complete', () => resolve());
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -0700160 });
Derick Montague602e98a2020-10-21 16:20:00 -0500161 const dimmSlotTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530162 this.$root.$on('hardware-status-dimm-slot-complete', () => resolve());
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700163 });
Derick Montague602e98a2020-10-21 16:20:00 -0500164 const fansTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530165 this.$root.$on('hardware-status-fans-complete', () => resolve());
Yoshie Muranakab89a53c2020-06-15 13:25:46 -0700166 });
Derick Montague602e98a2020-10-21 16:20:00 -0500167 const powerSuppliesTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530168 this.$root.$on('hardware-status-power-supplies-complete', () =>
Ed Tanous81323992024-02-27 11:26:24 -0800169 resolve(),
Yoshie Muranaka5918b482020-06-08 08:18:23 -0700170 );
171 });
Derick Montague602e98a2020-10-21 16:20:00 -0500172 const processorsTablePromise = new Promise((resolve) => {
Sukanya Pandeyedb8a772020-10-29 11:33:42 +0530173 this.$root.$on('hardware-status-processors-complete', () => resolve());
SurenNewaredc3fa2e2020-08-04 20:45:25 +0530174 });
Sukanya Pandey05388962021-06-10 15:35:21 +0530175 const serviceIndicatorPromise = new Promise((resolve) => {
176 this.$root.$on('hardware-status-service-complete', () => resolve());
177 });
178 const systemTablePromise = new Promise((resolve) => {
179 this.$root.$on('hardware-status-system-complete', () => resolve());
180 });
Sneha Patela02c6f92021-09-09 12:40:38 -0500181 const assemblyTablePromise = new Promise((resolve) => {
182 this.$root.$on('hardware-status-assembly-complete', () => resolve());
183 });
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700184 // Combine all child component Promises to indicate
185 // when page data load complete
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700186 Promise.all([
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700187 bmcManagerTablePromise,
Yoshie Muranaka09e8b5d2020-06-08 07:36:59 -0700188 chassisTablePromise,
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700189 dimmSlotTablePromise,
Yoshie Muranakab89a53c2020-06-15 13:25:46 -0700190 fansTablePromise,
SurenNewaredc3fa2e2020-08-04 20:45:25 +0530191 powerSuppliesTablePromise,
Derick Montague602e98a2020-10-21 16:20:00 -0500192 processorsTablePromise,
Sukanya Pandey05388962021-06-10 15:35:21 +0530193 serviceIndicatorPromise,
194 systemTablePromise,
Sneha Patela02c6f92021-09-09 12:40:38 -0500195 assemblyTablePromise,
Yoshie Muranakae24b17d2020-06-08 11:03:11 -0700196 ]).finally(() => this.endLoader());
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700197 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700198};
199</script>