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