diff options
Diffstat (limited to 'src/store/modules/HardwareStatus')
-rw-r--r-- | src/store/modules/HardwareStatus/BmcStore.js | 3 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/SensorsStore.js | 39 | ||||
-rw-r--r-- | src/store/modules/HardwareStatus/SystemStore.js | 3 |
3 files changed, 41 insertions, 4 deletions
diff --git a/src/store/modules/HardwareStatus/BmcStore.js b/src/store/modules/HardwareStatus/BmcStore.js index c6de412eb..a4c77cb9d 100644 --- a/src/store/modules/HardwareStatus/BmcStore.js +++ b/src/store/modules/HardwareStatus/BmcStore.js @@ -32,9 +32,6 @@ const BmcStore = { bmc.name = data.Name; bmc.partNumber = data.PartNumber; bmc.powerState = data.PowerState; - bmc.serialConsoleConnectTypes = data.SerialConsole.ConnectTypesSupported; - bmc.serialConsoleEnabled = data.SerialConsole.ServiceEnabled; - bmc.serialConsoleMaxSessions = data.SerialConsole.MaxConcurrentSessions; bmc.serialNumber = data.SerialNumber; bmc.serviceEntryPointUuid = data.ServiceEntryPointUUID; bmc.sparePartNumber = data.SparePartNumber; diff --git a/src/store/modules/HardwareStatus/SensorsStore.js b/src/store/modules/HardwareStatus/SensorsStore.js index 5d1ac4243..bb26561b6 100644 --- a/src/store/modules/HardwareStatus/SensorsStore.js +++ b/src/store/modules/HardwareStatus/SensorsStore.js @@ -41,7 +41,19 @@ const SensorsStore = { async resetSensors({ commit }) { commit('setSensorsDefault'); }, - async getSensors({ commit }, id) { + async getSensors({ dispatch }, id) { + await api + .get('/redfish/v1/') + .then(({ data }) => { + if (data?.ProtocolFeaturesSupported?.ExpandQuery?.MaxLevels > 0) { + return dispatch('getSensorsUsingQueryParams', id); + } else { + return dispatch('getSensorsWithoutQueryParams', id); + } + }) + .catch((error) => console.log(error)); + }, + async getSensorsWithoutQueryParams({ commit }, id) { const sensors = await api .get(`${id}/Sensors`) .then((response) => response.data.Members) @@ -72,6 +84,31 @@ const SensorsStore = { commit('setSensors', sensorData); }); }, + async getSensorsUsingQueryParams({ commit }, id) { + await api + .get(`${id}/Sensors?$expand=.($levels=1)`) + .then((response) => { + let sensorData = []; + response.data.Members.map((sensor) => { + const oneSensordata = { + name: sensor.Name, + status: sensor.Status?.Health, + currentValue: sensor.Reading, + lowerCaution: sensor.Thresholds?.LowerCaution?.Reading, + upperCaution: sensor.Thresholds?.UpperCaution?.Reading, + lowerCritical: sensor.Thresholds?.LowerCritical?.Reading, + upperCritical: sensor.Thresholds?.UpperCritical?.Reading, + units: sensor.ReadingUnits, + }; + sensorData.push(oneSensordata); + commit('setSensors', sensorData); + }); + }) + .then(() => { + return; + }) + .catch((error) => console.log(error)); + }, async getThermalSensors({ commit }, id) { return await api .get(`${id}/Thermal`) diff --git a/src/store/modules/HardwareStatus/SystemStore.js b/src/store/modules/HardwareStatus/SystemStore.js index 50c8b6f7d..7fbd6bc41 100644 --- a/src/store/modules/HardwareStatus/SystemStore.js +++ b/src/store/modules/HardwareStatus/SystemStore.js @@ -27,6 +27,9 @@ const SystemStore = { system.processorSummaryCoreCount = data.ProcessorSummary?.CoreCount; system.powerState = data.PowerState; system.serialNumber = data.SerialNumber; + system.serialConsoleEnabled = data.SerialConsole.ServiceEnabled; + system.serialConsoleMaxSessions = + data.SerialConsole.MaxConcurrentSessions; system.healthRollup = data.Status?.HealthRollup; system.subModel = data.SubModel; system.statusState = data.Status?.State; |