From 4aac0d5e752b9d5478499f49f0dba61c4286b9e8 Mon Sep 17 00:00:00 2001 From: Sukanya Pandey Date: Fri, 27 Aug 2021 20:15:37 +0530 Subject: [PATCH] Add functionality for lamp test (#1) - This feature adds the ability for the user to activate and deactivate lamp test and will be a downstream only feature. Signed-off-by: Sukanya Pandey --- src/locales/en-US.json | 9 ++- .../modules/HardwareStatus/SystemStore.js | 24 +++++++ .../HardwareStatus/Inventory/Inventory.vue | 2 +- .../Inventory/InventoryServiceIndicator.vue | 70 ++++++++++++++++--- 4 files changed, 93 insertions(+), 12 deletions(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 4718043798..afe886dcf2 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -377,8 +377,11 @@ "assemblies": "Assemblies", "systemIndicator": { "powerStatus": "Power status", + "attentionLed": "System attention LED", "identifyLed": "System identify LED", - "sectionTitle": "LED light control" + "lampTest": "Lamp test", + "tooltipInfo": "Changes all indicators controlled by the BMC and hypervisor to the ON state for four minutes.", + "sectionTitle": "System attention indicators" }, "table": { "assetTag": "Asset tag", @@ -441,7 +444,9 @@ }, "toast": { "errorDisableIdentifyLed": "Error disabling Identify LED.", - "errorEnableIdentifyLed": "Error enabling Identify LED." + "errorEnableIdentifyLed": "Error enabling Identify LED.", + "errorDisableLampTest": "Error disabling Lamp test.", + "errorEnableLampTest": "Error enabling Lamp test." } }, "pageKvm": { diff --git a/src/store/modules/HardwareStatus/SystemStore.js b/src/store/modules/HardwareStatus/SystemStore.js index a1394f1ee4..31a4a12a66 100644 --- a/src/store/modules/HardwareStatus/SystemStore.js +++ b/src/store/modules/HardwareStatus/SystemStore.js @@ -19,6 +19,7 @@ const SystemStore = { system.health = data.Status?.Health; system.totalSystemMemoryGiB = data.MemorySummary?.TotalSystemMemoryGiB; system.id = data.Id; + system.lampTest = data.Oem?.IBM?.LampTest; system.locationIndicatorActive = data.LocationIndicatorActive; system.locationNumber = data.Location?.PartLocation?.ServiceLabel; system.manufacturer = data.Manufacturer; @@ -71,6 +72,29 @@ const SystemStore = { } }); }, + async changeLampTestState({ commit }, lampTestState) { + return await api + .patch('/redfish/v1/Systems/system', { + Oem: { + IBM: { + LampTest: lampTestState, + }, + }, + }) + .catch((error) => { + commit('setSystemInfo', this.state.system.systems[0]); + console.log('error', error); + if (lampTestState) { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorEnableLampTest') + ); + } else { + throw new Error( + i18n.t('pageHardwareStatus.toast.errorDisableLampTest') + ); + } + }); + }, }, }; diff --git a/src/views/HardwareStatus/Inventory/Inventory.vue b/src/views/HardwareStatus/Inventory/Inventory.vue index fcdbf8d22d..780933d15b 100644 --- a/src/views/HardwareStatus/Inventory/Inventory.vue +++ b/src/views/HardwareStatus/Inventory/Inventory.vue @@ -50,7 +50,6 @@