diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-06-12 18:29:42 +0300 |
---|---|---|
committer | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-06-18 00:18:37 +0300 |
commit | 54c6bfc2d40def4db1bc3a13ab92ee71091b1e4f (patch) | |
tree | 19b739c20f1a61a3459ad130180e6ca376bced32 /src | |
parent | 09e8b5d478f212c094b7bea66c570fe0e673756e (diff) | |
download | webui-vue-54c6bfc2d40def4db1bc3a13ab92ee71091b1e4f.tar.xz |
Add BMC manager table to hardware status page
Add properties at /redfish/v1/Managers/bmc endpoint in a
table with expandable row to view details.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Ieb32a9b2a535ddd7d24edcb68761c51eace2e5a8
Diffstat (limited to 'src')
-rw-r--r-- | src/components/Mixins/TableDataFormatter.js | 3 | ||||
-rw-r--r-- | src/locales/en-US.json | 10 | ||||
-rw-r--r-- | src/store/index.js | 4 | ||||
-rw-r--r-- | src/store/modules/Health/BmcStore.js | 47 | ||||
-rw-r--r-- | src/views/Health/HardwareStatus/HardwareStatus.vue | 9 | ||||
-rw-r--r-- | src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue | 186 |
6 files changed, 257 insertions, 2 deletions
diff --git a/src/components/Mixins/TableDataFormatter.js b/src/components/Mixins/TableDataFormatter.js index e811f90a..027db610 100644 --- a/src/components/Mixins/TableDataFormatter.js +++ b/src/components/Mixins/TableDataFormatter.js @@ -18,6 +18,9 @@ const TableDataFormatter = { default: return ''; } + }, + tableFormatterArray(value) { + return value.join(', '); } } }; diff --git a/src/locales/en-US.json b/src/locales/en-US.json index f58054a8..43065348 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -130,26 +130,34 @@ "dimmSlot": "DIMM slot", "fans": "Fans", "powerSupplies": "Power supplies", + "bmcManager": "BMC manager", "chassis": "Chassis", "system": "System", "table": { "assetTag": "Asset tag", "chassisType": "Chassis type", + "connectTypesSupported": "Connect types supported", "description": "Description", "efficiencyPercent": "Efficiency percent", "firmwareVersion": "Firmware version", + "graphicalConsole": "Graphical console", "health": "Health", "id": "ID", "indicatorLed": "Indicator LED", "manufacturer": "Manufacturer", + "maxConcurrentSessions": "Max concurrent sessions", "model": "Model", "partNumber": "Part number", "powerInputWatts": "Power input watts", "powerState": "Power state", + "serialConsole": "Serial console", "serialNumber": "Serial number", + "serviceEnabled": "Service enabled", + "serviceEntryPointUuid": "Service entry point UUID", "statusHealthRollup": "Status (Health rollup)", "statusState": "Status (State)", - "systemType": "System type" + "systemType": "System type", + "uuid": "UUID" } }, "pageLdap": { diff --git a/src/store/index.js b/src/store/index.js index 0f921759..6ad05390 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -19,6 +19,7 @@ import PowerSupplyStore from './modules/Health/PowerSupplyStore'; import MemoryStore from './modules/Health/MemoryStore'; import FanStore from './modules/Health/FanStore'; import ChassisStore from './modules/Health/ChassisStore'; +import BmcStore from './modules/Health/BmcStore'; import WebSocketPlugin from './plugins/WebSocketPlugin'; @@ -46,7 +47,8 @@ export default new Vuex.Store({ system: SystemStore, memory: MemoryStore, fan: FanStore, - chassis: ChassisStore + chassis: ChassisStore, + bmc: BmcStore }, plugins: [WebSocketPlugin] }); diff --git a/src/store/modules/Health/BmcStore.js b/src/store/modules/Health/BmcStore.js new file mode 100644 index 00000000..784bd449 --- /dev/null +++ b/src/store/modules/Health/BmcStore.js @@ -0,0 +1,47 @@ +import api from '@/store/api'; + +const ChassisStore = { + namespaced: true, + state: { + bmc: null + }, + getters: { + bmc: state => state.bmc + }, + mutations: { + setBmcInfo: (state, data) => { + const bmc = {}; + bmc.description = data.Description; + bmc.firmwareVersion = data.FirmwareVersion; + bmc.graphicalConsoleConnectTypes = + data.GraphicalConsole.ConnectTypesSupported; + bmc.graphicalConsoleEnabled = data.GraphicalConsole.ServiceEnabled; + bmc.graphicalConsoleMaxSessions = + data.GraphicalConsole.MaxConcurrentSessions; + bmc.health = data.Status.Health; + bmc.healthRollup = data.Status.HealthRollup; + bmc.id = data.Id; + bmc.model = data.Model; + bmc.partNumber = data.PartNumber; + bmc.powerState = data.PowerState; + bmc.serialConsoleConnectTypes = data.SerialConsole.ConnectTypesSupported; + bmc.serialConsoleEnabled = data.SerialConsole.ServiceEnabled; + bmc.serialConsoleMaxSessions = data.SerialConsole.MaxConcurrentSessions; + bmc.serialNumber = data.SerialNumber; + bmc.serviceEntryPointUuid = data.ServiceEntryPointUUID; + bmc.statusState = data.Status.State; + bmc.uuid = data.UUID; + state.bmc = bmc; + } + }, + actions: { + async getBmcInfo({ commit }) { + return await api + .get('/redfish/v1/Managers/bmc') + .then(({ data }) => commit('setBmcInfo', data)) + .catch(error => console.log(error)); + } + } +}; + +export default ChassisStore; diff --git a/src/views/Health/HardwareStatus/HardwareStatus.vue b/src/views/Health/HardwareStatus/HardwareStatus.vue index 598313e1..364baad2 100644 --- a/src/views/Health/HardwareStatus/HardwareStatus.vue +++ b/src/views/Health/HardwareStatus/HardwareStatus.vue @@ -5,6 +5,9 @@ <!-- System table --> <table-system /> + <!-- BMC manager table --> + <table-bmc-manager /> + <!-- Chassis table --> <table-chassis /> @@ -25,6 +28,7 @@ import TableSystem from './HardwareStatusTableStystem'; import TablePowerSupplies from './HardwareStatusTablePowerSupplies'; import TableDimmSlot from './HardwareStatusTableDimmSlot'; import TableFans from './HardwareStatusTableFans'; +import TableBmcManager from './HardwareStatusTableBmcManager'; import TableChassis from './HardwareStatusTableChassis'; import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin'; @@ -35,6 +39,7 @@ export default { TablePowerSupplies, TableSystem, TableFans, + TableBmcManager, TableChassis }, mixins: [LoadingBarMixin], @@ -43,6 +48,9 @@ export default { const systemTablePromise = new Promise(resolve => { this.$root.$on('hardwareStatus::system::complete', () => resolve()); }); + const bmcManagerTablePromise = new Promise(resolve => { + this.$root.$on('hardwareStatus::bmcManager::complete', () => resolve()); + }); const chassisTablePromise = new Promise(resolve => { this.$root.$on('hardwareStatus::chassis::complete', () => resolve()); }); @@ -61,6 +69,7 @@ export default { // when page data load complete Promise.all([ systemTablePromise, + bmcManagerTablePromise, chassisTablePromise, dimmSlotTablePromise, fansTablePromise, diff --git a/src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue b/src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue new file mode 100644 index 00000000..94dde6d4 --- /dev/null +++ b/src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue @@ -0,0 +1,186 @@ +<template> + <page-section :section-title="$t('pageHardwareStatus.bmcManager')"> + <b-table :items="items" :fields="fields"> + <!-- Expand chevron icon --> + <template v-slot:cell(expandRow)="row"> + <b-button variant="link" @click="row.toggleDetails"> + <icon-chevron /> + </b-button> + </template> + + <!-- Health --> + <template v-slot:cell(health)="{ value }"> + <status-icon :status="statusIcon(value)" /> + {{ value }} + </template> + + <template v-slot:row-details="{ item }"> + <b-container fluid> + <b-row> + <b-col sm="6"> + <dl> + <!-- Description --> + <dt class="d-block"> + {{ $t('pageHardwareStatus.table.description') }}: + </dt> + <dd class="mb-4"> + {{ tableFormatter(item.description) }} + </dd> + <br /> + <!-- Firmware version --> + <dt class="d-block"> + {{ $t('pageHardwareStatus.table.firmwareVersion') }}: + </dt> + <dd class="mb-4"> + {{ tableFormatter(item.firmwareVersion) }} + </dd> + <br /> + <!-- Service entry point UUID --> + <dt class="d-block"> + {{ $t('pageHardwareStatus.table.serviceEntryPointUuid') }}: + </dt> + <dd class="mb-4"> + {{ tableFormatter(item.serviceEntryPointUuid) }} + </dd> + <br /> + <!-- UUID --> + <dt class="d-block"> + {{ $t('pageHardwareStatus.table.uuid') }}: + </dt> + <dd class="mb-4"> + {{ tableFormatter(item.uuid) }} + </dd> + </dl> + </b-col> + <b-col sm="6"> + <dl> + <!-- Power state --> + <dt>{{ $t('pageHardwareStatus.table.powerState') }}:</dt> + <dd>{{ tableFormatter(item.powerState) }}</dd> + <br /> + + <!-- Model --> + <dt>{{ $t('pageHardwareStatus.table.model') }}:</dt> + <dd>{{ tableFormatter(item.model) }}</dd> + <br /> + + <!-- Health rollup --> + <dt> + {{ $t('pageHardwareStatus.table.statusHealthRollup') }}: + </dt> + <dd>{{ tableFormatter(item.healthRollup) }}</dd> + <br /> + + <!-- Status state --> + <dt>{{ $t('pageHardwareStatus.table.statusState') }}:</dt> + <dd>{{ tableFormatter(item.statusState) }}</dd> + <br /> + + <!-- Graphical console --> + <dt class="font-weight-bold mt-3 mb-2 d-block"> + {{ $t('pageHardwareStatus.table.graphicalConsole') }} + </dt> + <dt> + {{ $t('pageHardwareStatus.table.connectTypesSupported') }}: + </dt> + <dd> + {{ tableFormatterArray(item.graphicalConsoleConnectTypes) }} + </dd> + <br /> + <dt> + {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}: + </dt> + <dd>{{ tableFormatter(item.graphicalConsoleMaxSessions) }}</dd> + <br /> + <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt> + <dd>{{ tableFormatter(item.graphicalConsoleEnabled) }}</dd> + <br /> + + <!-- Serial console --> + <dt class="font-weight-bold mt-3 mb-2 d-block"> + {{ $t('pageHardwareStatus.table.serialConsole') }} + </dt> + <dt> + {{ $t('pageHardwareStatus.table.connectTypesSupported') }}: + </dt> + <dd> + {{ tableFormatterArray(item.serialConsoleConnectTypes) }} + </dd> + <br /> + <dt> + {{ $t('pageHardwareStatus.table.maxConcurrentSessions') }}: + </dt> + <dd>{{ tableFormatter(item.serialConsoleMaxSessions) }}</dd> + <br /> + <dt>{{ $t('pageHardwareStatus.table.serviceEnabled') }}:</dt> + <dd>{{ tableFormatter(item.serialConsoleEnabled) }}</dd> + </dl> + </b-col> + </b-row> + </b-container> + </template> + </b-table> + </page-section> +</template> + +<script> +import PageSection from '@/components/Global/PageSection'; +import IconChevron from '@carbon/icons-vue/es/chevron--down/20'; + +import StatusIcon from '@/components/Global/StatusIcon'; +import TableDataFormatter from '@/components/Mixins/TableDataFormatter'; + +export default { + components: { IconChevron, PageSection, StatusIcon }, + mixins: [TableDataFormatter], + data() { + return { + fields: [ + { + key: 'expandRow', + label: '', + tdClass: 'table-row-expand' + }, + { + key: 'id', + label: this.$t('pageHardwareStatus.table.id'), + formatter: this.tableFormatter + }, + { + key: 'health', + label: this.$t('pageHardwareStatus.table.health'), + formatter: this.tableFormatter + }, + { + key: 'partNumber', + label: this.$t('pageHardwareStatus.table.partNumber'), + formatter: this.tableFormatter + }, + { + key: 'serialNumber', + label: this.$t('pageHardwareStatus.table.serialNumber'), + formatter: this.tableFormatter + } + ] + }; + }, + computed: { + bmc() { + return this.$store.getters['bmc/bmc']; + }, + items() { + if (this.bmc) { + return [this.bmc]; + } else { + return []; + } + } + }, + created() { + this.$store.dispatch('bmc/getBmcInfo').finally(() => { + // Emit intial data fetch complete to parent component + this.$root.$emit('hardwareStatus::bmcManager::complete'); + }); + } +}; +</script> |