diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2024-03-05 12:01:35 +0300 |
---|---|---|
committer | Kiran Kumar Ballapalli <kirankumarb@ami.com> | 2024-03-08 11:22:30 +0300 |
commit | 2e6c7cc4b0737c53eccbcc83e766ee2a642dc952 (patch) | |
tree | 3bff5a6d37b4937af75b19ecfd91a1fca1860a33 | |
parent | 04bd217ede39fc7c71989cc4d65cac1349fdafd1 (diff) | |
download | webui-vue-2e6c7cc4b0737c53eccbcc83e766ee2a642dc952.tar.xz |
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 <gmills@us.ibm.com>
Change-Id: I4952daf30f9b654234dd0e838adebc38cc8c380f
-rw-r--r-- | .env.ibm | 1 | ||||
-rw-r--r-- | .env.intel | 3 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/FanStore.js | 106 |
3 files changed, 35 insertions, 75 deletions
@@ -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 @@ -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)); }, }, }; |