diff options
Diffstat (limited to 'src/store')
-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 | ||||
-rw-r--r-- | src/store/modules/Operations/FirmwareStore.js | 34 |
4 files changed, 58 insertions, 21 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; diff --git a/src/store/modules/Operations/FirmwareStore.js b/src/store/modules/Operations/FirmwareStore.js index 78d3b9125..411b0bdd4 100644 --- a/src/store/modules/Operations/FirmwareStore.js +++ b/src/store/modules/Operations/FirmwareStore.js @@ -5,23 +5,23 @@ const FirmwareStore = { namespaced: true, state: { bmcFirmware: [], - hostFirmware: [], + biosFirmware: [], bmcActiveFirmwareId: null, - hostActiveFirmwareId: null, + biosActiveFirmwareId: null, applyTime: null, multipartHttpPushUri: null, httpPushUri: null, }, getters: { - isSingleFileUploadEnabled: (state) => state.hostFirmware.length === 0, + isSingleFileUploadEnabled: (state) => state.biosFirmware.length === 0, activeBmcFirmware: (state) => { return state.bmcFirmware.find( (firmware) => firmware.id === state.bmcActiveFirmwareId, ); }, - activeHostFirmware: (state) => { - return state.hostFirmware.find( - (firmware) => firmware.id === state.hostActiveFirmwareId, + activeBiosFirmware: (state) => { + return state.biosFirmware.find( + (firmware) => firmware.id === state.biosActiveFirmwareId, ); }, backupBmcFirmware: (state) => { @@ -29,17 +29,17 @@ const FirmwareStore = { (firmware) => firmware.id !== state.bmcActiveFirmwareId, ); }, - backupHostFirmware: (state) => { - return state.hostFirmware.find( - (firmware) => firmware.id !== state.hostActiveFirmwareId, + backupBiosFirmware: (state) => { + return state.biosFirmware.find( + (firmware) => firmware.id !== state.biosActiveFirmwareId, ); }, }, mutations: { setActiveBmcFirmwareId: (state, id) => (state.bmcActiveFirmwareId = id), - setActiveHostFirmwareId: (state, id) => (state.hostActiveFirmwareId = id), + setActiveBiosFirmwareId: (state, id) => (state.biosActiveFirmwareId = id), setBmcFirmware: (state, firmware) => (state.bmcFirmware = firmware), - setHostFirmware: (state, firmware) => (state.hostFirmware = firmware), + setBiosFirmware: (state, firmware) => (state.biosFirmware = firmware), setApplyTime: (state, applyTime) => (state.applyTime = applyTime), setHttpPushUri: (state, httpPushUri) => (state.httpPushUri = httpPushUri), setMultipartHttpPushUri: (state, multipartHttpPushUri) => @@ -47,7 +47,7 @@ const FirmwareStore = { }, actions: { async getFirmwareInformation({ dispatch }) { - dispatch('getActiveHostFirmware'); + dispatch('getActiveBiosFirmware'); dispatch('getActiveBmcFirmware'); return await dispatch('getFirmwareInventory'); }, @@ -60,12 +60,12 @@ const FirmwareStore = { }) .catch((error) => console.log(error)); }, - async getActiveHostFirmware({ commit }) { + async getActiveBiosFirmware({ commit }) { return api .get(`${await this.dispatch('global/getSystemPath')}/Bios`) .then(({ data: { Links } }) => { const id = Links?.ActiveSoftwareImage['@odata.id'].split('/').pop(); - commit('setActiveHostFirmwareId', id); + commit('setActiveBiosFirmwareId', id); }) .catch((error) => console.log(error)); }, @@ -80,7 +80,7 @@ const FirmwareStore = { .all(inventoryList) .then((response) => { const bmcFirmware = []; - const hostFirmware = []; + const biosFirmware = []; response.forEach(({ data }) => { const firmwareType = data?.RelatedItem?.[0]?.['@odata.id'] .split('/') @@ -94,11 +94,11 @@ const FirmwareStore = { if (firmwareType === 'bmc') { bmcFirmware.push(item); } else if (firmwareType === 'Bios') { - hostFirmware.push(item); + biosFirmware.push(item); } }); commit('setBmcFirmware', bmcFirmware); - commit('setHostFirmware', hostFirmware); + commit('setBiosFirmware', biosFirmware); }) .catch((error) => { console.log(error); |