From 1eee9a48259edc04c89e8f3863c7966091641850 Mon Sep 17 00:00:00 2001 From: Kamalkumar <108823339+Patel-Kamalkumar@users.noreply.github.com> Date: Wed, 17 Jan 2024 21:23:57 +0530 Subject: [PATCH] Adding Led's to enhance use experience - Adding custom LED component to enhance visual representation of physical LED State which will be dipict the original system LED colour and it's behaviour. - When user toggle the identify LED button then as current behaviour toast message will be appears for the LED status but as part of this change when user toggle identify LED button then it's appears as LED button and colour of the LED continuously blinking based on toggle button status. - For each toggle button behaviour is different as similar as Hardware LED colour code. - For example: Dimms, fans, processor etc LED colour representation are amber and system identify LED colour is blue as similar as Hardware colour. Signed-off-by: Kamalkumar <108823339+Patel-Kamalkumar@users.noreply.github.com> --- src/components/Global/LedComponent.vue | 133 ++++++++++++++++++ src/store/modules/HardwareStatus/BmcStore.js | 1 + src/store/modules/HardwareStatus/FanStore.js | 1 + .../modules/HardwareStatus/PcieSlotsStore.js | 1 + .../HardwareStatus/PowerSupplyStore.js | 1 + .../modules/HardwareStatus/ProcessorStore.js | 1 + .../modules/HardwareStatus/SystemStore.js | 29 ++++ .../Inventory/InventoryFabricAdapters.vue | 39 ++++- .../Inventory/InventoryServiceIndicator.vue | 79 ++++++++++- .../Inventory/InventoryTableAssembly.vue | 49 ++++++- .../Inventory/InventoryTableBmcManager.vue | 34 ++++- .../Inventory/InventoryTableChassis.vue | 37 ++++- .../Inventory/InventoryTableDimmSlot.vue | 43 +++++- .../Inventory/InventoryTableFans.vue | 37 ++++- .../Inventory/InventoryTablePcieSlots.vue | 47 ++++++- .../Inventory/InventoryTablePowerSupplies.vue | 50 ++++++- .../Inventory/InventoryTableProcessors.vue | 45 +++++- 17 files changed, 594 insertions(+), 33 deletions(-) create mode 100644 src/components/Global/LedComponent.vue diff --git a/src/components/Global/LedComponent.vue b/src/components/Global/LedComponent.vue new file mode 100644 index 0000000000..464d054c4c --- /dev/null +++ b/src/components/Global/LedComponent.vue @@ -0,0 +1,133 @@ + + + + + + diff --git a/src/store/modules/HardwareStatus/BmcStore.js b/src/store/modules/HardwareStatus/BmcStore.js index bbdf6b1232..c97dd5d981 100644 --- a/src/store/modules/HardwareStatus/BmcStore.js +++ b/src/store/modules/HardwareStatus/BmcStore.js @@ -17,6 +17,7 @@ const BmcStore = { bmc.health = data.Status.Health; bmc.id = data.Id; bmc.identifyLed = data.LocationIndicatorActive; + bmc.ledStatus = data.LocationIndicatorActive; bmc.locationNumber = data.Location?.PartLocation?.ServiceLabel; bmc.model = data.Model; bmc.name = data.Name; diff --git a/src/store/modules/HardwareStatus/FanStore.js b/src/store/modules/HardwareStatus/FanStore.js index dc74214ae2..29d07464f0 100644 --- a/src/store/modules/HardwareStatus/FanStore.js +++ b/src/store/modules/HardwareStatus/FanStore.js @@ -29,6 +29,7 @@ const FanStore = { partNumber: PartNumber, serialNumber: SerialNumber, identifyLed: LocationIndicatorActive, + ledStatus: LocationIndicatorActive, locationNumber: Location?.PartLocation?.ServiceLabel, model: Model, name: Name, diff --git a/src/store/modules/HardwareStatus/PcieSlotsStore.js b/src/store/modules/HardwareStatus/PcieSlotsStore.js index e173270f60..cbd3589982 100644 --- a/src/store/modules/HardwareStatus/PcieSlotsStore.js +++ b/src/store/modules/HardwareStatus/PcieSlotsStore.js @@ -16,6 +16,7 @@ const PcieSlotsStore = { return { type: SlotType, identifyLed: LocationIndicatorActive, + ledStatus: LocationIndicatorActive, locationNumber: Location?.PartLocation?.ServiceLabel, }; }); diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js index 7281cb2820..e783c5efac 100644 --- a/src/store/modules/HardwareStatus/PowerSupplyStore.js +++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js @@ -31,6 +31,7 @@ const PowerSupplyStore = { serialNumber: SerialNumber, firmwareVersion: FirmwareVersion, identifyLed: LocationIndicatorActive, + ledStatus: LocationIndicatorActive, locationNumber: Location?.PartLocation?.ServiceLabel, model: Model, name: Name, diff --git a/src/store/modules/HardwareStatus/ProcessorStore.js b/src/store/modules/HardwareStatus/ProcessorStore.js index 400c364601..a80458b13f 100644 --- a/src/store/modules/HardwareStatus/ProcessorStore.js +++ b/src/store/modules/HardwareStatus/ProcessorStore.js @@ -38,6 +38,7 @@ const ProcessorStore = { totalCores: TotalCores, locationNumber: Location?.PartLocation?.ServiceLabel, identifyLed: LocationIndicatorActive, + ledStatus: LocationIndicatorActive, uri: processor['@odata.id'], }; }); diff --git a/src/store/modules/HardwareStatus/SystemStore.js b/src/store/modules/HardwareStatus/SystemStore.js index 213e69cb8a..1631af7518 100644 --- a/src/store/modules/HardwareStatus/SystemStore.js +++ b/src/store/modules/HardwareStatus/SystemStore.js @@ -21,11 +21,14 @@ const SystemStore = { system.sysAttentionLed = data.Oem?.IBM?.PartitionSystemAttentionIndicator || data.Oem?.IBM?.PlatformSystemAttentionIndicator; + system.issysAttentionLed = system.sysAttentionLed; system.locationIndicatorActive = data.LocationIndicatorActive; + system.issysidentifyLed = data.LocationIndicatorActive; system.model = data.Model; system.processorSummaryCoreCount = data.ProcessorSummary?.CoreCount; system.processorSummaryCount = data.ProcessorSummary?.Count; system.powerState = data.PowerState; + system.powerLedStatus = data.PowerState; system.serialNumber = data.SerialNumber; system.statusState = data.Status?.State; state.systems = [system]; @@ -67,6 +70,32 @@ const SystemStore = { } }); }, + async PowerStatusLedState({ commit }, ledState) { + return await api + .patch('/redfish/v1/Systems/system', { + powerLedStatus: ledState, + }) + .then(() => { + if (ledState) { + return i18n.t('pageInventory.toast.successEnableIdentifyLed'); + } else { + return i18n.t('pageInventory.toast.successDisableIdentifyLed'); + } + }) + .catch((error) => { + commit('setSystemInfo', this.state.system.systems[0]); + console.log('error', error); + if (ledState) { + throw new Error( + i18n.t('pageInventory.toast.errorEnableIdentifyLed') + ); + } else { + throw new Error( + i18n.t('pageInventory.toast.errorDisableIdentifyLed') + ); + } + }); + }, async changeSystemAttentionLedState({ commit }, ledState) { return await api .patch('/redfish/v1/Systems/system', { diff --git a/src/views/HardwareStatus/Inventory/InventoryFabricAdapters.vue b/src/views/HardwareStatus/Inventory/InventoryFabricAdapters.vue index 551effcd79..bd55174104 100644 --- a/src/views/HardwareStatus/Inventory/InventoryFabricAdapters.vue +++ b/src/views/HardwareStatus/Inventory/InventoryFabricAdapters.vue @@ -91,6 +91,18 @@