diff options
author | Dixsie Wolmers <dixsie@ibm.com> | 2020-02-13 22:29:40 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2020-02-25 01:50:31 +0300 |
commit | 9d40e308fb33d5cef91deb8d78451ab021614898 (patch) | |
tree | 08a2c0b46fecb551bb95becc5138e2803486cef5 /src/store/modules/Configuration | |
parent | 0e893f03bbcb2fa2cc6ce128091ba68b8ea93e8f (diff) | |
download | webui-vue-9d40e308fb33d5cef91deb8d78451ab021614898.tar.xz |
Update overview events table and overview network layout
- Convert events list group to bootstrap table
- Add ethernet interfaces to overview using redfish
Signed-off-by: Dixsie Wolmers <dixsie@ibm.com>
Change-Id: I633f03ba4a65358861664a869b35adf5358c45e6
Diffstat (limited to 'src/store/modules/Configuration')
-rw-r--r-- | src/store/modules/Configuration/NetworkSettingsStore.js | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/src/store/modules/Configuration/NetworkSettingsStore.js b/src/store/modules/Configuration/NetworkSettingsStore.js index ee58a77b..3b1f2320 100644 --- a/src/store/modules/Configuration/NetworkSettingsStore.js +++ b/src/store/modules/Configuration/NetworkSettingsStore.js @@ -3,40 +3,36 @@ import api from '../../api'; const NetworkSettingsStore = { namespaced: true, state: { - networkData: null, - ipAddress: '--', - macAddress: '--' + ethernetData: [] }, getters: { - networkData: state => state.networkData, - ipAddress: state => state.ipAddress, - macAddress: state => state.macAddress + ethernetData: state => state.ethernetData }, mutations: { - setNetworkData: (state, networkData) => (state.networkData = networkData), - setIpAddress: (state, ipAddress) => (state.ipAddress = ipAddress), - setMacAddress: (state, macAddress) => (state.macAddress = macAddress) + setEthernetData: (state, ethernetData) => + (state.ethernetData = ethernetData) }, actions: { - getNetworkData({ commit }) { + getEthernetData({ commit }) { api - .get('/xyz/openbmc_project/network/enumerate') - .then(response => { - const networkData = response.data.data; - const ipAddresses = []; - const interfaceId = /eth[0-9]/; - for (let key in networkData) { - if (key.includes('ipv4')) { - ipAddresses.push(networkData[key].Address); - } - if ( - key.match(interfaceId) && - networkData[key].MACAddress !== undefined - ) { - commit('setMacAddress', networkData[key].MACAddress); - } - } - commit('setIpAddress', ipAddresses); + .get('/redfish/v1/Managers/bmc/EthernetInterfaces') + .then(response => + response.data.Members.map( + ethernetInterface => ethernetInterface['@odata.id'] + ) + ) + .then(ethernetInterfaceIds => + api.all( + ethernetInterfaceIds.map(ethernetInterface => + api.get(ethernetInterface) + ) + ) + ) + .then(ethernetInterfaces => { + const ethernetData = ethernetInterfaces.map( + ethernetInterface => ethernetInterface.data + ); + commit('setEthernetData', ethernetData); }) .catch(error => { console.log('Network Data:', error); |