summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.env.ibm1
-rw-r--r--.env.intel3
-rw-r--r--src/store/modules/HardwareStatus/FanStore.js106
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));
},
},
};