Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 1 | <template> |
| 2 | <page-section :section-title="$t('pageHardwareStatus.bmcManager')"> |
SurenNeware | 307382e | 2020-07-27 20:45:14 +0530 | [diff] [blame] | 3 | <b-table |
| 4 | responsive="md" |
Sukanya Pandey | fde429e | 2020-09-14 20:48:39 +0530 | [diff] [blame] | 5 | hover |
SurenNeware | 307382e | 2020-07-27 20:45:14 +0530 | [diff] [blame] | 6 | :items="items" |
| 7 | :fields="fields" |
| 8 | show-empty |
| 9 | :empty-text="$t('global.table.emptyMessage')" |
| 10 | > |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 11 | <!-- Expand chevron icon --> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 12 | <template #cell(expandRow)="row"> |
Dixsie Wolmers | 8313376 | 2020-07-15 08:45:19 -0500 | [diff] [blame] | 13 | <b-button |
| 14 | variant="link" |
| 15 | data-test-id="hardwareStatus-button-expandBmc" |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 16 | :aria-label="expandRowLabel" |
Dixsie Wolmers | 30f11f8 | 2020-11-10 16:07:56 -0600 | [diff] [blame] | 17 | :title="expandRowLabel" |
| 18 | class="btn-icon-only" |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 19 | @click="toggleRowDetails(row)" |
Dixsie Wolmers | 8313376 | 2020-07-15 08:45:19 -0500 | [diff] [blame] | 20 | > |
Dixsie Wolmers | 30f11f8 | 2020-11-10 16:07:56 -0600 | [diff] [blame] | 21 | <icon-chevron /> |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 22 | </b-button> |
| 23 | </template> |
| 24 | |
| 25 | <!-- Health --> |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 26 | <template #cell(health)="{ value }"> |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 27 | <status-icon :status="statusIcon(value)" /> |
| 28 | {{ value }} |
| 29 | </template> |
| 30 | |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 31 | <template #row-details="{ item }"> |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 32 | <b-container fluid> |
| 33 | <b-row> |
| 34 | <b-col sm="6"> |
| 35 | <dl> |
| 36 | <!-- Description --> |
| 37 | <dt class="d-block"> |
| 38 | {{ $t('pageHardwareStatus.table.description') }}: |
| 39 | </dt> |
| 40 | <dd class="mb-4"> |
| 41 | {{ tableFormatter(item.description) }} |
| 42 | </dd> |
| 43 | <br /> |
| 44 | <!-- Firmware version --> |
| 45 | <dt class="d-block"> |
| 46 | {{ $t('pageHardwareStatus.table.firmwareVersion') }}: |
| 47 | </dt> |
| 48 | <dd class="mb-4"> |
| 49 | {{ tableFormatter(item.firmwareVersion) }} |
| 50 | </dd> |
| 51 | <br /> |
| 52 | <!-- Service entry point UUID --> |
| 53 | <dt class="d-block"> |
| 54 | {{ $t('pageHardwareStatus.table.serviceEntryPointUuid') }}: |
| 55 | </dt> |
| 56 | <dd class="mb-4"> |
| 57 | {{ tableFormatter(item.serviceEntryPointUuid) }} |
| 58 | </dd> |
| 59 | <br /> |
| 60 | <!-- UUID --> |
| 61 | <dt class="d-block"> |
| 62 | {{ $t('pageHardwareStatus.table.uuid') }}: |
| 63 | </dt> |
| 64 | <dd class="mb-4"> |
| 65 | {{ tableFormatter(item.uuid) }} |
| 66 | </dd> |
| 67 | </dl> |
| 68 | </b-col> |
| 69 | <b-col sm="6"> |
| 70 | <dl> |
| 71 | <!-- Power state --> |
| 72 | <dt>{{ $t('pageHardwareStatus.table.powerState') }}:</dt> |
| 73 | <dd>{{ tableFormatter(item.powerState) }}</dd> |
| 74 | <br /> |
| 75 | |
| 76 | <!-- Model --> |
| 77 | <dt>{{ $t('pageHardwareStatus.table.model') }}:</dt> |
| 78 | <dd>{{ tableFormatter(item.model) }}</dd> |
| 79 | <br /> |
| 80 | |
| 81 | <!-- Health rollup --> |
| 82 | <dt> |
| 83 | {{ $t('pageHardwareStatus.table.statusHealthRollup') }}: |
| 84 | </dt> |
| 85 | <dd>{{ tableFormatter(item.healthRollup) }}</dd> |
| 86 | <br /> |
| 87 | |
| 88 | <!-- Status state --> |
| 89 | <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt> |
| 90 | <dd>{{ tableFormatter(item.statusState) }}</dd> |
| 91 | <br /> |
| 92 | |
| 93 | <!-- Graphical console --> |
| 94 | <dt class="font-weight-bold mt-3 mb-2 d-block"> |
| 95 | {{ $t('pageHardwareStatus.table.graphicalConsole') }} |
| 96 | </dt> |
| 97 | <dt> |
| 98 | {{ $t('pageHardwareStatus.table.connectTypesSupported') }}: |
| 99 | </dt> |
| 100 | <dd> |
| 101 | {{ tableFormatterArray(item.graphicalConsoleConnectTypes) }} |
| 102 | </dd> |
| 103 | <br /> |
| 104 | <dt> |
| 105 | {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}: |
| 106 | </dt> |
| 107 | <dd>{{ tableFormatter(item.graphicalConsoleMaxSessions) }}</dd> |
| 108 | <br /> |
| 109 | <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt> |
| 110 | <dd>{{ tableFormatter(item.graphicalConsoleEnabled) }}</dd> |
| 111 | <br /> |
| 112 | |
| 113 | <!-- Serial console --> |
| 114 | <dt class="font-weight-bold mt-3 mb-2 d-block"> |
| 115 | {{ $t('pageHardwareStatus.table.serialConsole') }} |
| 116 | </dt> |
| 117 | <dt> |
| 118 | {{ $t('pageHardwareStatus.table.connectTypesSupported') }}: |
| 119 | </dt> |
| 120 | <dd> |
| 121 | {{ tableFormatterArray(item.serialConsoleConnectTypes) }} |
| 122 | </dd> |
| 123 | <br /> |
| 124 | <dt> |
| 125 | {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}: |
| 126 | </dt> |
| 127 | <dd>{{ tableFormatter(item.serialConsoleMaxSessions) }}</dd> |
| 128 | <br /> |
| 129 | <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt> |
| 130 | <dd>{{ tableFormatter(item.serialConsoleEnabled) }}</dd> |
| 131 | </dl> |
| 132 | </b-col> |
| 133 | </b-row> |
| 134 | </b-container> |
| 135 | </template> |
| 136 | </b-table> |
| 137 | </page-section> |
| 138 | </template> |
| 139 | |
| 140 | <script> |
| 141 | import PageSection from '@/components/Global/PageSection'; |
| 142 | import IconChevron from '@carbon/icons-vue/es/chevron--down/20'; |
| 143 | |
| 144 | import StatusIcon from '@/components/Global/StatusIcon'; |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 145 | |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 146 | import TableRowExpandMixin, { |
| 147 | expandRowLabel, |
| 148 | } from '@/components/Mixins/TableRowExpandMixin'; |
Yoshie Muranaka | 386df45 | 2020-06-18 12:45:13 -0700 | [diff] [blame] | 149 | import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin'; |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 150 | |
| 151 | export default { |
| 152 | components: { IconChevron, PageSection, StatusIcon }, |
Dixsie Wolmers | b53e086 | 2020-09-08 14:13:38 -0500 | [diff] [blame] | 153 | mixins: [TableRowExpandMixin, TableDataFormatterMixin], |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 154 | data() { |
| 155 | return { |
| 156 | fields: [ |
| 157 | { |
| 158 | key: 'expandRow', |
| 159 | label: '', |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 160 | tdClass: 'table-row-expand', |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 161 | }, |
| 162 | { |
| 163 | key: 'id', |
| 164 | label: this.$t('pageHardwareStatus.table.id'), |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 165 | formatter: this.tableFormatter, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 166 | }, |
| 167 | { |
| 168 | key: 'health', |
| 169 | label: this.$t('pageHardwareStatus.table.health'), |
Dixsie Wolmers | a04d46f | 2020-10-22 06:34:56 -0500 | [diff] [blame] | 170 | formatter: this.tableFormatter, |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 171 | tdClass: 'text-nowrap', |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 172 | }, |
| 173 | { |
| 174 | key: 'partNumber', |
| 175 | label: this.$t('pageHardwareStatus.table.partNumber'), |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 176 | formatter: this.tableFormatter, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 177 | }, |
| 178 | { |
| 179 | key: 'serialNumber', |
| 180 | label: this.$t('pageHardwareStatus.table.serialNumber'), |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 181 | formatter: this.tableFormatter, |
| 182 | }, |
| 183 | ], |
SurenNeware | ba91c49 | 2020-10-27 14:18:54 +0530 | [diff] [blame] | 184 | expandRowLabel: expandRowLabel, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 185 | }; |
| 186 | }, |
| 187 | computed: { |
| 188 | bmc() { |
| 189 | return this.$store.getters['bmc/bmc']; |
| 190 | }, |
| 191 | items() { |
| 192 | if (this.bmc) { |
| 193 | return [this.bmc]; |
| 194 | } else { |
| 195 | return []; |
| 196 | } |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 197 | }, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 198 | }, |
| 199 | created() { |
| 200 | this.$store.dispatch('bmc/getBmcInfo').finally(() => { |
Gunnar Mills | defc9e2 | 2020-07-07 20:29:03 -0500 | [diff] [blame] | 201 | // Emit initial data fetch complete to parent component |
Sukanya Pandey | edb8a77 | 2020-10-29 11:33:42 +0530 | [diff] [blame] | 202 | this.$root.$emit('hardware-status-bmc-manager-complete'); |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 203 | }); |
Derick Montague | 602e98a | 2020-10-21 16:20:00 -0500 | [diff] [blame] | 204 | }, |
Yoshie Muranaka | 54c6bfc | 2020-06-12 08:29:42 -0700 | [diff] [blame] | 205 | }; |
| 206 | </script> |