blob: 8a0671e5cadfcc1b191ebb13bf30f470aa154a27 [file] [log] [blame]
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -07001<template>
Sandeepa Singh7affc522021-07-06 16:29:10 +05302 <page-section :section-title="$t('pageInventory.bmcManager')">
SurenNeware307382e2020-07-27 20:45:14 +05303 <b-table
4 responsive="md"
Sukanya Pandeyfde429e2020-09-14 20:48:39 +05305 hover
jason westoverd36ac8a2025-11-03 20:58:59 -06006 thead-class="table-light"
SurenNeware307382e2020-07-27 20:45:14 +05307 :items="items"
8 :fields="fields"
9 show-empty
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 Muranaka54c6bfc2020-06-12 08:29:42 -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-expandBmc"
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 Muranaka54c6bfc2020-06-12 08:29:42 -070025 </b-button>
26 </template>
27
28 <!-- Health -->
Derick Montague602e98a2020-10-21 16:20:00 -050029 <template #cell(health)="{ value }">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070030 <status-icon :status="statusIcon(value)" />
31 {{ value }}
32 </template>
33
Sandeepa Singh78b6b532021-04-09 18:08:22 +053034 <!-- Toggle identify LED -->
35 <template #cell(identifyLed)="row">
36 <b-form-checkbox
37 v-if="hasIdentifyLed(row.item.identifyLed)"
38 v-model="row.item.identifyLed"
39 name="switch"
40 switch
41 @change="toggleIdentifyLedValue(row.item)"
42 >
43 <span v-if="row.item.identifyLed">
44 {{ $t('global.status.on') }}
45 </span>
46 <span v-else> {{ $t('global.status.off') }} </span>
47 </b-form-checkbox>
48 <div v-else>--</div>
49 </template>
50
Derick Montague602e98a2020-10-21 16:20:00 -050051 <template #row-details="{ item }">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070052 <b-container fluid>
53 <b-row>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053054 <b-col class="mt-2" sm="6" xl="6">
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070055 <dl>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053056 <!-- Name -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053057 <dt>{{ $t('pageInventory.table.name') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050058 <dd>{{ dataFormatter(item.name) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053059 <!-- Part number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053060 <dt>{{ $t('pageInventory.table.partNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050061 <dd>{{ dataFormatter(item.partNumber) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053062 <!-- Serial number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053063 <dt>{{ $t('pageInventory.table.serialNumber') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050064 <dd>{{ dataFormatter(item.serialNumber) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053065 <!-- Spare part number -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053066 <dt>{{ $t('pageInventory.table.sparePartNumber') }}:</dt>
jason westoverd36ac8a2025-11-03 20:58:59 -060067 <dd>
68 {{ dataFormatter(item.sparePartNumber) }}
69 </dd>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070070 <!-- Model -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053071 <dt>{{ $t('pageInventory.table.model') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050072 <dd>{{ dataFormatter(item.model) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053073 <!-- UUID -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053074 <dt>{{ $t('pageInventory.table.uuid') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050075 <dd>{{ dataFormatter(item.uuid) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053076 <!-- Service entry point UUID -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053077 <dt>{{ $t('pageInventory.table.serviceEntryPointUuid') }}:</dt>
jason westoverd36ac8a2025-11-03 20:58:59 -060078 <dd>
79 {{ dataFormatter(item.serviceEntryPointUuid) }}
80 </dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053081 </dl>
82 </b-col>
83 <b-col class="mt-2" sm="6" xl="6">
84 <dl>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -070085 <!-- Status state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053086 <dt>{{ $t('pageInventory.table.statusState') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050087 <dd>{{ dataFormatter(item.statusState) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053088 <!-- Power state -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053089 <dt>{{ $t('pageInventory.table.power') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050090 <dd>{{ dataFormatter(item.powerState) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053091 <!-- Health rollup -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053092 <dt>{{ $t('pageInventory.table.healthRollup') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -050093 <dd>{{ dataFormatter(item.healthRollup) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053094 <!-- BMC date and time -->
Sandeepa Singh7affc522021-07-06 16:29:10 +053095 <dt>{{ $t('pageInventory.table.bmcDateTime') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +053096 <dd>
Surya Vde23ea22024-07-11 15:19:46 +053097 {{ $filters.formatDate(item.dateTime) }}
98 {{ $filters.formatTime(item.dateTime) }}
Sandeepa Singh78b6b532021-04-09 18:08:22 +053099 </dd>
100 <!-- Reset date and time -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530101 <dt>{{ $t('pageInventory.table.lastResetTime') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530102 <dd>
Surya Vde23ea22024-07-11 15:19:46 +0530103 {{ $filters.formatDate(item.lastResetTime) }}
104 {{ $filters.formatTime(item.lastResetTime) }}
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530105 </dd>
106 </dl>
107 </b-col>
108 </b-row>
109 <div class="section-divider mb-3 mt-3"></div>
110 <b-row>
111 <b-col class="mt-2" sm="6" xl="6">
112 <dl>
113 <!-- Manufacturer -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530114 <dt>{{ $t('pageInventory.table.manufacturer') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500115 <dd>{{ dataFormatter(item.manufacturer) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530116 <!-- Description -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530117 <dt>{{ $t('pageInventory.table.description') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500118 <dd>{{ dataFormatter(item.description) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530119 <!-- Manager type -->
Sandeepa Singh7affc522021-07-06 16:29:10 +0530120 <dt>{{ $t('pageInventory.table.managerType') }}:</dt>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500121 <dd>{{ dataFormatter(item.managerType) }}</dd>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530122 </dl>
123 </b-col>
124 <b-col class="mt-2" sm="6" xl="6">
Sandeepa Singh4c039192021-07-02 21:36:45 +0530125 <!-- Firmware Version -->
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530126 <dl>
Sandeepa Singh5287a8b2021-08-16 15:00:27 +0530127 <dt>{{ $t('pageInventory.table.firmwareVersion') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530128 <dd>{{ item.firmwareVersion }}</dd>
Sandeepa Singh4c039192021-07-02 21:36:45 +0530129 </dl>
130 <!-- Graphical console -->
131 <p class="mt-1 mb-2 h6 float-none m-0">
Sandeepa Singh5287a8b2021-08-16 15:00:27 +0530132 {{ $t('pageInventory.table.graphicalConsole') }}
Sandeepa Singh4c039192021-07-02 21:36:45 +0530133 </p>
jason westoverd36ac8a2025-11-03 20:58:59 -0600134 <dl class="ms-4">
Sandeepa Singh7affc522021-07-06 16:29:10 +0530135 <dt>{{ $t('pageInventory.table.connectTypesSupported') }}:</dt>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700136 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500137 {{ dataFormatterArray(item.graphicalConsoleConnectTypes) }}
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700138 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530139 <dt>{{ $t('pageInventory.table.maxConcurrentSessions') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530140 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500141 {{ dataFormatter(item.graphicalConsoleMaxSessions) }}
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530142 </dd>
Sandeepa Singh7affc522021-07-06 16:29:10 +0530143 <dt>{{ $t('pageInventory.table.serviceEnabled') }}:</dt>
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530144 <dd>
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500145 {{ dataFormatter(item.graphicalConsoleEnabled) }}
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530146 </dd>
Sandeepa Singh4c039192021-07-02 21:36:45 +0530147 </dl>
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700148 </b-col>
149 </b-row>
150 </b-container>
151 </template>
152 </b-table>
153 </page-section>
154</template>
155
156<script>
157import PageSection from '@/components/Global/PageSection';
158import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700159import StatusIcon from '@/components/Global/StatusIcon';
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530160import BVToastMixin from '@/components/Mixins/BVToastMixin';
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 Muranaka54c6bfc2020-06-12 08:29:42 -0700167
168export default {
169 components: { IconChevron, PageSection, StatusIcon },
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500170 mixins: [BVToastMixin, TableRowExpandMixin, DataFormatterMixin],
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -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 Muranaka54c6bfc2020-06-12 08:29:42 -0700175 fields: [
176 {
177 key: 'expandRow',
178 label: '',
Derick Montague602e98a2020-10-21 16:20:00 -0500179 tdClass: 'table-row-expand',
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -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 Muranaka54c6bfc2020-06-12 08:29:42 -0700185 },
186 {
187 key: 'health',
Surya Vde23ea22024-07-11 15:19:46 +0530188 label: i18n.global.t('pageInventory.table.health'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500189 formatter: this.dataFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700190 },
191 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530192 key: 'locationNumber',
Surya Vde23ea22024-07-11 15:19:46 +0530193 label: i18n.global.t('pageInventory.table.locationNumber'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500194 formatter: this.dataFormatter,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700195 },
196 {
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530197 key: 'identifyLed',
Surya Vde23ea22024-07-11 15:19:46 +0530198 label: i18n.global.t('pageInventory.table.identifyLed'),
Dixsie Wolmers9726f9a2021-09-07 15:33:16 -0500199 formatter: this.dataFormatter,
Derick Montague602e98a2020-10-21 16:20:00 -0500200 },
201 ],
SurenNewareba91c492020-10-27 14:18:54 +0530202 expandRowLabel: expandRowLabel,
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700203 };
204 },
205 computed: {
206 bmc() {
207 return this.$store.getters['bmc/bmc'];
208 },
209 items() {
210 if (this.bmc) {
211 return [this.bmc];
212 } else {
213 return [];
214 }
Derick Montague602e98a2020-10-21 16:20:00 -0500215 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700216 },
217 created() {
218 this.$store.dispatch('bmc/getBmcInfo').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(
221 'hardware-status-bmc-manager-complete',
222 );
Kenneth Fullbright41057852021-12-27 16:19:37 -0600223 this.isBusy = false;
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700224 });
Derick Montague602e98a2020-10-21 16:20:00 -0500225 },
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530226 methods: {
227 toggleIdentifyLedValue(row) {
228 this.$store
229 .dispatch('bmc/updateIdentifyLedValue', {
230 uri: row.uri,
231 identifyLed: row.identifyLed,
232 })
Nikhil Ashokaf11a1902024-05-09 15:17:44 +0530233 .then((message) => this.successToast(message))
Sandeepa Singh78b6b532021-04-09 18:08:22 +0530234 .catch(({ message }) => this.errorToast(message));
235 },
236 // TO DO: remove hasIdentifyLed method once the following story is merged:
237 // https://gerrit.openbmc-project.xyz/c/openbmc/bmcweb/+/43179
238 hasIdentifyLed(identifyLed) {
239 return typeof identifyLed === 'boolean';
240 },
241 },
Yoshie Muranaka54c6bfc2020-06-12 08:29:42 -0700242};
243</script>