blob: a3cb0cf268b8bfe37c6f1daf0ed5529a489700c5 [file] [log] [blame]
Yoshie Muranaka56ee7692020-05-28 13:28:29 -07001<template>
Sandeepa Singh7affc522021-07-06 16:29:10 +05302 <page-section :section-title="$t('pageInventory.system')">
SurenNeware307382e2020-07-27 20:45:14 +05303 <b-table
4 responsive="md"
Sukanya Pandeyfde429e2020-09-14 20:48:39 +05305 hover
SurenNeware307382e2020-07-27 20:45:14 +05306 show-empty
jason westoverd36ac8a2025-11-03 20:58:59 -06007 thead-class="table-light"
SurenNeware307382e2020-07-27 20:45:14 +05308 :items="systems"
9 :fields="fields"
10 :empty-text="$t('global.table.emptyMessage')"
Kenneth Fullbright41057852021-12-27 16:19:37 -060011 :busy="isBusy"
SurenNeware307382e2020-07-27 20:45:14 +053012 >
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070013 <!-- Expand chevron icon -->
Derick Montague602e98a2020-10-21 16:20:00 -050014 <template #cell(expandRow)="row">
Dixsie Wolmers83133762020-07-15 08:45:19 -050015 <b-button
16 variant="link"
17 data-test-id="hardwareStatus-button-expandSystem"
Dixsie Wolmers30f11f82020-11-10 16:07:56 -060018 :title="expandRowLabel"
19 class="btn-icon-only"
jason westoverd36ac8a2025-11-03 20:58:59 -060020 :class="{ collapsed: !row.detailsShowing }"
Dixsie Wolmersb53e0862020-09-08 14:13:38 -050021 @click="toggleRowDetails(row)"
Dixsie Wolmers83133762020-07-15 08:45:19 -050022 >
Dixsie Wolmers30f11f82020-11-10 16:07:56 -060023 <icon-chevron />
jason westoverd36ac8a2025-11-03 20:58:59 -060024 <span class="visually-hidden">{{ expandRowLabel }}</span>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070025 </b-button>
26 </template>
27
28 <!-- Health -->
Derick Montague602e98a2020-10-21 16:20:00 -050029 <template #cell(health)="{ value }">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070030 <status-icon :status="statusIcon(value)" />
31 {{ value }}
32 </template>
33
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053034 <template #cell(locationIndicatorActive)="{ item }">
35 <b-form-checkbox
Sukanya Pandey05388962021-06-10 15:35:21 +053036 id="identifyLedSwitchSystem"
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053037 v-model="item.locationIndicatorActive"
Sukanya Pandey05388962021-06-10 15:35:21 +053038 data-test-id="inventorySystem-toggle-identifyLed"
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053039 switch
40 @change="toggleIdentifyLedSwitch"
41 >
Sukanya Pandey05388962021-06-10 15:35:21 +053042 <span v-if="item.locationIndicatorActive">
43 {{ $t('global.status.on') }}
44 </span>
45 <span v-else>{{ $t('global.status.off') }}</span>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053046 </b-form-checkbox>
47 </template>
48
Derick Montague602e98a2020-10-21 16:20:00 -050049 <template #row-details="{ item }">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070050 <b-container fluid>
51 <b-row>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053052 <b-col class="mt-2" sm="6">
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070053 <dl>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053054 <!-- Serial number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053055 <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050056 <dd>{{ dataFormatter(item.serialNumber) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053057 <!-- Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053058 <dt>{{ $t('pageInventory.table.model') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050059 <dd>{{ dataFormatter(item.model) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070060 <!-- Asset tag -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053061 <dt>{{ $t('pageInventory.table.assetTag') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053062 <dd class="mb-2">
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050063 {{ dataFormatter(item.assetTag) }}
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053064 </dd>
65 </dl>
66 </b-col>
67 <b-col class="mt-2" sm="6">
68 <dl>
69 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053070 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050071 <dd>{{ dataFormatter(item.statusState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053072 <!-- Power state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053073 <dt>{{ $t('pageInventory.table.power') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050074 <dd>{{ dataFormatter(item.powerState) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053075 <!-- Health rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053076 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050077 <dd>{{ dataFormatter(item.healthRollup) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053078 </dl>
79 </b-col>
80 </b-row>
81 <div class="section-divider mb-3 mt-3"></div>
82 <b-row>
83 <b-col class="mt-1" sm="6">
84 <dl>
85 <!-- Manufacturer -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053086 <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt>
Thang Q. Nguyenc6899362021-10-20 02:08:49 +000087 <dd>{{ dataFormatter(item.manufacturer) }}</dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -070088 <!-- Description -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053089 <dt>{{ $t('pageInventory.table.description') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050090 <dd>{{ dataFormatter(item.description) }}</dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053091 <!-- Sub Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053092 <dt>{{ $t('pageInventory.table.subModel') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053093 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050094 {{ dataFormatter(item.subModel) }}
SurenNewarebbf896c2021-01-27 21:50:22 +053095 </dd>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053096 <!-- System Type -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053097 <dt>{{ $t('pageInventory.table.systemType') }}:</dt>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +053098 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050099 {{ dataFormatter(item.systemType) }}
SurenNewarebbf896c2021-01-27 21:50:22 +0530100 </dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700101 </dl>
102 </b-col>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530103 <b-col sm="6">
Sandeepa Singh1908ac92021-08-31 16:38:17 +0530104 <!-- Memory Summary -->
105 <p class="mt-1 mb-2 h6 float-none m-0">
106 {{ $t('pageInventory.table.memorySummary') }}
107 </p>
jason westoverd36ac8a2025-11-03 20:58:59 -0600108 <dl class="ms-4">
Nikhil Ashoka18cde3c2022-01-05 22:21:24 +0530109 <!-- Total system memory -->
110 <dt>{{ $t('pageInventory.table.totalSystemMemoryGiB') }}:</dt>
Glukhov Mikhaild0b078f2022-12-24 12:16:53 +0300111 <dd>
112 {{ dataFormatter(item.totalSystemMemoryGiB) }}
113 {{ $t('unit.GiB') }}
114 </dd>
Sandeepa Singh1908ac92021-08-31 16:38:17 +0530115 </dl>
116 <!-- Processor Summary -->
117 <p class="mt-1 mb-2 h6 float-none m-0">
118 {{ $t('pageInventory.table.processorSummary') }}
119 </p>
jason westoverd36ac8a2025-11-03 20:58:59 -0600120 <dl class="ms-4">
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530121 <!-- Count -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530122 <dt>{{ $t('pageInventory.table.count') }}:</dt>
jason westoverd36ac8a2025-11-03 20:58:59 -0600123 <dd>
124 {{ dataFormatter(item.processorSummaryCount) }}
125 </dd>
Nikhil Ashoka18cde3c2022-01-05 22:21:24 +0530126 <!-- Core Count -->
127 <dt>{{ $t('pageInventory.table.coreCount') }}:</dt>
jason westoverd36ac8a2025-11-03 20:58:59 -0600128 <dd>
129 {{ dataFormatter(item.processorSummaryCoreCount) }}
130 </dd>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700131 </dl>
Tan Siewert223fe5b2025-01-17 19:47:28 +0100132 <!-- Serial console -->
133 <p class="mt-1 mb-2 h6 float-none m-0">
134 {{ $t('pageInventory.table.serialConsole') }}
135 </p>
jason westoverd36ac8a2025-11-03 20:58:59 -0600136 <dl class="ms-4">
Tan Siewert223fe5b2025-01-17 19:47:28 +0100137 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
jason westoverd36ac8a2025-11-03 20:58:59 -0600138 <dd>
139 {{ dataFormatter(item.serialConsoleMaxSessions) }}
140 </dd>
Tan Siewert223fe5b2025-01-17 19:47:28 +0100141 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
jason westoverd36ac8a2025-11-03 20:58:59 -0600142 <dd>
143 {{ dataFormatter(item.serialConsoleEnabled) }}
144 </dd>
Tan Siewert223fe5b2025-01-17 19:47:28 +0100145 </dl>
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700146 </b-col>
147 </b-row>
148 </b-container>
149 </template>
150 </b-table>
151 </page-section>
152</template>
153
154<script>
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530155import BVToastMixin from '@/components/Mixins/BVToastMixin';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700156import PageSection from '@/components/Global/PageSection';
157import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
158
159import StatusIcon from '@/components/Global/StatusIcon';
Dixsie Wolmersb53e0862020-09-08 14:13:38 -0500160
SurenNewareba91c492020-10-27 14:18:54 +0530161import TableRowExpandMixin, {
162 expandRowLabel,
163} from '@/components/Mixins/TableRowExpandMixin';
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500164import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
Surya Vde23ea22024-07-11 15:19:46 +0530165import { useI18n } from 'vue-i18n';
166import i18n from '@/i18n';
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700167
168export default {
169 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500170 mixins: [BVToastMixin, TableRowExpandMixin, DataFormatterMixin],
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700171 data() {
172 return {
Surya Vde23ea22024-07-11 15:19:46 +0530173 $t: useI18n().t,
Kenneth Fullbright41057852021-12-27 16:19:37 -0600174 isBusy: true,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700175 fields: [
176 {
177 key: 'expandRow',
178 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500179 tdClass: 'table-row-expand',
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700180 },
181 {
182 key: 'id',
Surya Vde23ea22024-07-11 15:19:46 +0530183 label: i18n.global.t('pageInventory.table.id'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500184 formatter: this.dataFormatter,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700185 },
186 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530187 key: 'hardwareType',
Surya Vde23ea22024-07-11 15:19:46 +0530188 label: i18n.global.t('pageInventory.table.hardwareType'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500189 formatter: this.dataFormatter,
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530190 tdClass: 'text-nowrap',
191 },
192 {
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700193 key: 'health',
Surya Vde23ea22024-07-11 15:19:46 +0530194 label: i18n.global.t('pageInventory.table.health'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500195 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500196 tdClass: 'text-nowrap',
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700197 },
198 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530199 key: 'locationNumber',
Surya Vde23ea22024-07-11 15:19:46 +0530200 label: i18n.global.t('pageInventory.table.locationNumber'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500201 formatter: this.dataFormatter,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700202 },
203 {
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530204 key: 'locationIndicatorActive',
Surya Vde23ea22024-07-11 15:19:46 +0530205 label: i18n.global.t('pageInventory.table.identifyLed'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500206 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500207 },
208 ],
SurenNewareba91c492020-10-27 14:18:54 +0530209 expandRowLabel: expandRowLabel,
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700210 };
211 },
212 computed: {
213 systems() {
214 return this.$store.getters['system/systems'];
Derick Montague602e98a2020-10-21 16:20:00 -0500215 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700216 },
217 created() {
218 this.$store.dispatch('system/getSystem').finally(() => {
Gunnar Millsdefc9e22020-07-07 20:29:03 -0500219 // Emit initial data fetch complete to parent component
jason westoverd36ac8a2025-11-03 20:58:59 -0600220 require('@/eventBus').default.$emit('hardware-status-system-complete');
Kenneth Fullbright41057852021-12-27 16:19:37 -0600221 this.isBusy = false;
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700222 });
Derick Montague602e98a2020-10-21 16:20:00 -0500223 },
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530224 methods: {
225 toggleIdentifyLedSwitch(state) {
226 this.$store
227 .dispatch('system/changeIdentifyLedState', state)
Nikhil Ashokaf11a1902024-05-09 15:17:44 +0530228 .then((message) => this.successToast(message))
Sukanya Pandeyeb4cef32021-04-09 15:40:27 +0530229 .catch(({ message }) => this.errorToast(message));
230 },
231 },
Yoshie Muranaka56ee7692020-05-28 13:28:29 -0700232};
233</script>