From 78b6b53d5248d9dc0293af8190c6a69fbaf2ccb0 Mon Sep 17 00:00:00 2001 From: Sandeepa Singh Date: Fri, 9 Apr 2021 18:08:22 +0530 Subject: Add BMC table missing properties - Added the following properties: Name, Spare part number, Manufacturer type, Manager type, BMC date and time, Last reset time, Identify led Signed-off-by: Sandeepa Singh Change-Id: I6d84f867f3c272f3989f76c86f054f143b8b1bbd --- src/locales/en-US.json | 5 +- src/store/modules/Health/BmcStore.js | 36 ++++- .../HardwareStatusTableBmcManager.vue | 162 ++++++++++++++------- 3 files changed, 146 insertions(+), 57 deletions(-) (limited to 'src') diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 33048f6d..8ec50e96 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -375,6 +375,7 @@ "system": "System", "table": { "assetTag": "Asset tag", + "bmcDateTime": "BMC date and time", "chassisType": "Chassis type", "connectTypesSupported": "Connect types supported", "description": "Description", @@ -388,9 +389,10 @@ "id": "ID", "identifyLed": "Identify LED", "indicatorLed": "Indicator LED", - "locationNumber": "Location number", "instructionSet": "Instruction set", + "lastResetTime": "Last reset time", "locationNumber": "Location number", + "managerType": "Manager type", "manufacturer": "Manufacturer", "maxConcurrentSessions": "Max concurrent sessions", "maxSpeedMHz": "Max speed MHz", @@ -398,6 +400,7 @@ "model": "Model", "name": "Name", "partNumber": "Part number", + "power": "Power", "powerInputWatts": "Power input watts", "powerState": "Power state", "processorArchitecture": "Processor architecture", diff --git a/src/store/modules/Health/BmcStore.js b/src/store/modules/Health/BmcStore.js index 73df10b8..bbe157eb 100644 --- a/src/store/modules/Health/BmcStore.js +++ b/src/store/modules/Health/BmcStore.js @@ -1,6 +1,7 @@ import api from '@/store/api'; +import i18n from '@/i18n'; -const ChassisStore = { +const BmcStore = { namespaced: true, state: { bmc: null, @@ -11,6 +12,7 @@ const ChassisStore = { mutations: { setBmcInfo: (state, data) => { const bmc = {}; + bmc.dateTime = new Date(data.DateTime); bmc.description = data.Description; bmc.firmwareVersion = data.FirmwareVersion; bmc.graphicalConsoleConnectTypes = @@ -21,7 +23,13 @@ const ChassisStore = { bmc.health = data.Status.Health; bmc.healthRollup = data.Status.HealthRollup; bmc.id = data.Id; + bmc.lastResetTime = new Date(data.LastResetTime); + bmc.identifyLed = data.LocationIndicatorActive; + bmc.locationNumber = data.LocationNumber; + bmc.manufacturer = data.manufacturer; + bmc.managerType = data.ManagerType; bmc.model = data.Model; + bmc.name = data.Name; bmc.partNumber = data.PartNumber; bmc.powerState = data.PowerState; bmc.serialConsoleConnectTypes = data.SerialConsole.ConnectTypesSupported; @@ -29,8 +37,10 @@ const ChassisStore = { bmc.serialConsoleMaxSessions = data.SerialConsole.MaxConcurrentSessions; bmc.serialNumber = data.SerialNumber; bmc.serviceEntryPointUuid = data.ServiceEntryPointUUID; + bmc.sparePartNumber = data.SparePartNumber; bmc.statusState = data.Status.State; bmc.uuid = data.UUID; + bmc.uri = data['@odata.id']; state.bmc = bmc; }, }, @@ -41,7 +51,29 @@ const ChassisStore = { .then(({ data }) => commit('setBmcInfo', data)) .catch((error) => console.log(error)); }, + async updateIdentifyLedValue({ dispatch }, led) { + const uri = led.uri; + const updatedIdentifyLedValue = { + LocationIndicatorActive: led.identifyLed, + }; + return await api + .patch(uri, updatedIdentifyLedValue) + .then(() => dispatch('getBmcInfo')) + .catch((error) => { + dispatch('getBmcInfo'); + console.log('error', error); + if (led.identifyLed) { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorEnableIdentifyLed') + ); + } else { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorDisableIdentifyLed') + ); + } + }); + }, }, }; -export default ChassisStore; +export default BmcStore; diff --git a/src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue b/src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue index 2feced86..96736736 100644 --- a/src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue +++ b/src/views/Health/HardwareStatus/HardwareStatusTableBmcManager.vue @@ -28,63 +28,101 @@ {{ value }} + + +