summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorDixsie Wolmers <dixsie@ibm.com>2021-09-24 22:35:34 +0300
committerDixsie Wolmers <dixsiew@gmail.com>2021-11-09 18:15:57 +0300
commit182b3f1ff44b7319767dcc4c50fe54515602b9fa (patch)
tree495845c3ca19a91f15ba38bd9988dbdc8ed8070d /src/store
parentae09a4b3c03dcf86616820ab9d8c0c7ef9ebc69c (diff)
downloadwebui-vue-182b3f1ff44b7319767dcc4c50fe54515602b9fa.tar.xz
Fix overview error
Console errors were related to the power and network card components from https://gerrit.openbmc-project.xyz/c/openbmc/webui-vue/+/46511 Signed-off-by: Dixsie Wolmers <dixsie@ibm.com> Change-Id: Ib967229b74462ed8d5c28cbac24c2a2fbfc834c2
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/Settings/NetworkStore.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/store/modules/Settings/NetworkStore.js b/src/store/modules/Settings/NetworkStore.js
index 4040658a..65a83b44 100644
--- a/src/store/modules/Settings/NetworkStore.js
+++ b/src/store/modules/Settings/NetworkStore.js
@@ -8,11 +8,13 @@ const NetworkStore = {
defaultGateway: '',
ethernetData: [],
interfaceOptions: [],
+ globalNetworkSettings: [],
},
getters: {
defaultGateway: (state) => state.defaultGateway,
ethernetData: (state) => state.ethernetData,
interfaceOptions: (state) => state.interfaceOptions,
+ globalNetworkSettings: (state) => state.globalNetworkSettings,
},
mutations: {
setDefaultGateway: (state, defaultGateway) =>
@@ -21,6 +23,24 @@ const NetworkStore = {
(state.ethernetData = ethernetData),
setInterfaceOptions: (state, interfaceOptions) =>
(state.interfaceOptions = interfaceOptions),
+ setGlobalNetworkSettings: (state, data) => {
+ state.globalNetworkSettings = data.map(({ data }) => {
+ const {
+ HostName,
+ LinkStatus,
+ IPv4StaticAddresses,
+ IPv4Addresses,
+ } = data;
+ return {
+ hostname: HostName,
+ linkStatus: LinkStatus,
+ staticAddress: IPv4StaticAddresses[0]?.Address,
+ dhcpAddress: IPv4Addresses.filter(
+ (ipv4) => ipv4.AddressOrigin === 'DHCP'
+ ),
+ };
+ });
+ },
},
actions: {
async getEthernetData({ commit }) {
@@ -52,6 +72,7 @@ const NetworkStore = {
return ipv4.Gateway;
});
+ commit('setGlobalNetworkSettings', ethernetInterfaces);
commit('setDefaultGateway', defaultGateway[0]);
commit('setEthernetData', ethernetData);
commit('setInterfaceOptions', interfaceOptions);