From 2e6c7cc4b0737c53eccbcc83e766ee2a642dc952 Mon Sep 17 00:00:00 2001 From: Gunnar Mills Date: Tue, 5 Mar 2024 02:01:35 -0700 Subject: Move to new ThermalSubsystem Remove VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM. Assume any Redfish implementation we are using has the new ThermalSubsystem. bmcweb, the only webserver, webui-vue supports today, enabled this by default at https://gerrit.openbmc.org/c/openbmc/bmcweb/+/69228 ThermalSubsystem, PowerSubsystem has been out since 2020.4, so it is reasonable to assume it is there in any modern Redfish implementation. Tested: Nabil tested and verified this worked. Signed-off-by: Gunnar Mills Change-Id: I4952daf30f9b654234dd0e838adebc38cc8c380f --- .env.ibm | 1 - .env.intel | 3 +- src/store/modules/HardwareStatus/FanStore.js | 106 +++++++++------------------ 3 files changed, 35 insertions(+), 75 deletions(-) diff --git a/.env.ibm b/.env.ibm index 39cc4163..cbfe7bb5 100644 --- a/.env.ibm +++ b/.env.ibm @@ -2,7 +2,6 @@ NODE_ENV=production VUE_APP_ENV_NAME=ibm VUE_APP_COMPANY_NAME="IBM" VUE_APP_GUI_NAME="BMC System Management" -VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM="true" CUSTOM_STYLES=true CUSTOM_APP_NAV=true CUSTOM_ROUTER=true diff --git a/.env.intel b/.env.intel index c7dea364..382e7fb6 100644 --- a/.env.intel +++ b/.env.intel @@ -8,8 +8,7 @@ VUE_APP_MODIFY_SSH_POLICY_DISABLED="true" VUE_APP_VIRTUAL_MEDIA_LIST_ENABLED="true" VUE_APP_EVENT_LOGS_DELETE_BUTTON_DISABLED="true" VUE_APP_EVENT_LOGS_TOGGLE_BUTTON_DISABLED="true" -VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM="true" CUSTOM_STYLES="true" CUSTOM_APP_NAV="true" CUSTOM_STORE="true" -CUSTOM_ROUTER="true" \ No newline at end of file +CUSTOM_ROUTER="true" diff --git a/src/store/modules/HardwareStatus/FanStore.js b/src/store/modules/HardwareStatus/FanStore.js index 104f8452..202a4328 100644 --- a/src/store/modules/HardwareStatus/FanStore.js +++ b/src/store/modules/HardwareStatus/FanStore.js @@ -11,49 +11,24 @@ const FanStore = { mutations: { setFanInfo: (state, data) => { state.fans = data.map((fan) => { - const ThermalSubsystem = - process.env.VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM === 'true' - ? true - : false; - if (ThermalSubsystem) { - const { - Id, - Name, - PartNumber, - SerialNumber, - SpeedPercent = {}, - Status = {}, - } = fan; - return { - id: Id, - health: Status.Health, - name: Name, - speed: SpeedPercent.Reading, - statusState: Status.State, - healthRollup: Status.HealthRollup, - partNumber: PartNumber, - serialNumber: SerialNumber, - }; - } else { - const { - MemberId, - Name, - Reading, - Status = {}, - PartNumber, - SerialNumber, - } = fan; - return { - id: MemberId, - health: Status.Health, - partNumber: PartNumber, - serialNumber: SerialNumber, - healthRollup: Status.HealthRollup, - name: Name, - speed: Reading, - statusState: Status.State, - }; - } + const { + Id, + Name, + PartNumber, + SerialNumber, + SpeedPercent = {}, + Status = {}, + } = fan; + return { + id: Id, + health: Status.Health, + name: Name, + speed: SpeedPercent.Reading, + statusState: Status.State, + healthRollup: Status.HealthRollup, + partNumber: PartNumber, + serialNumber: SerialNumber, + }; }); }, }, @@ -79,35 +54,22 @@ const FanStore = { .catch((error) => console.log(error)); }, async getChassisFans(_, chassis) { - const ThermalSubsystem = - process.env.VUE_APP_FAN_DATA_FROM_THERMAL_SUBSYSTEM === 'true' - ? true - : false; - if (ThermalSubsystem) { - return await api - .get(chassis.ThermalSubsystem['@odata.id']) - .then((response) => { - return api.get(`${response.data.Fans['@odata.id']}`); - }) - .then(({ data: { Members } }) => { - const promises = Members.map((member) => - api.get(member['@odata.id']), - ); - return api.all(promises); - }) - .then((response) => { - const data = response.map(({ data }) => data); - return data; - }) - .catch((error) => console.log(error)); - } else { - return await api - .get(chassis.Thermal['@odata.id']) - .then(({ data: { Fans } }) => { - return Fans || []; - }) - .catch((error) => console.log(error)); - } + return await api + .get(chassis.ThermalSubsystem['@odata.id']) + .then((response) => { + return api.get(`${response.data.Fans['@odata.id']}`); + }) + .then(({ data: { Members } }) => { + const promises = Members.map((member) => + api.get(member['@odata.id']), + ); + return api.all(promises); + }) + .then((response) => { + const data = response.map(({ data }) => data); + return data; + }) + .catch((error) => console.log(error)); }, }, }; -- cgit v1.2.3