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