summaryrefslogtreecommitdiff
path: root/src/store/modules/Configuration/NetworkSettingsStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/Configuration/NetworkSettingsStore.js')
-rw-r--r--src/store/modules/Configuration/NetworkSettingsStore.js40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/store/modules/Configuration/NetworkSettingsStore.js b/src/store/modules/Configuration/NetworkSettingsStore.js
index ae1de3d2..9cdcd415 100644
--- a/src/store/modules/Configuration/NetworkSettingsStore.js
+++ b/src/store/modules/Configuration/NetworkSettingsStore.js
@@ -7,12 +7,12 @@ const NetworkSettingsStore = {
state: {
defaultGateway: '',
ethernetData: [],
- interfaceOptions: []
+ interfaceOptions: [],
},
getters: {
- defaultGateway: state => state.defaultGateway,
- ethernetData: state => state.ethernetData,
- interfaceOptions: state => state.interfaceOptions
+ defaultGateway: (state) => state.defaultGateway,
+ ethernetData: (state) => state.ethernetData,
+ interfaceOptions: (state) => state.interfaceOptions,
},
mutations: {
setDefaultGateway: (state, defaultGateway) =>
@@ -20,35 +20,35 @@ const NetworkSettingsStore = {
setEthernetData: (state, ethernetData) =>
(state.ethernetData = ethernetData),
setInterfaceOptions: (state, interfaceOptions) =>
- (state.interfaceOptions = interfaceOptions)
+ (state.interfaceOptions = interfaceOptions),
},
actions: {
async getEthernetData({ commit }) {
return await api
.get('/redfish/v1/Managers/bmc/EthernetInterfaces')
- .then(response =>
+ .then((response) =>
response.data.Members.map(
- ethernetInterface => ethernetInterface['@odata.id']
+ (ethernetInterface) => ethernetInterface['@odata.id']
)
)
- .then(ethernetInterfaceIds =>
+ .then((ethernetInterfaceIds) =>
api.all(
- ethernetInterfaceIds.map(ethernetInterface =>
+ ethernetInterfaceIds.map((ethernetInterface) =>
api.get(ethernetInterface)
)
)
)
- .then(ethernetInterfaces => {
+ .then((ethernetInterfaces) => {
const ethernetData = ethernetInterfaces.map(
- ethernetInterface => ethernetInterface.data
+ (ethernetInterface) => ethernetInterface.data
);
const interfaceOptions = ethernetInterfaces.map(
- ethernetName => ethernetName.data.Id
+ (ethernetName) => ethernetName.data.Id
);
const addresses = ethernetData[0].IPv4StaticAddresses;
// Default gateway manually set to first gateway saved on the first interface. Default gateway property is WIP on backend
- const defaultGateway = addresses.map(ipv4 => {
+ const defaultGateway = addresses.map((ipv4) => {
return ipv4.Gateway;
});
@@ -56,7 +56,7 @@ const NetworkSettingsStore = {
commit('setEthernetData', ethernetData);
commit('setInterfaceOptions', interfaceOptions);
})
- .catch(error => {
+ .catch((error) => {
console.log('Network Data:', error);
});
},
@@ -67,10 +67,10 @@ const NetworkSettingsStore = {
state.ethernetData[networkSettingsForm.selectedInterfaceIndex]
.IPv4StaticAddresses;
- const addressArray = originalAddresses.map(item => {
+ const addressArray = originalAddresses.map((item) => {
const address = item.Address;
if (find(updatedAddresses, { Address: address })) {
- remove(updatedAddresses, item => {
+ remove(updatedAddresses, (item) => {
return item.Address === address;
});
return {};
@@ -81,7 +81,7 @@ const NetworkSettingsStore = {
const data = {
HostName: networkSettingsForm.hostname,
- MACAddress: networkSettingsForm.macAddress
+ MACAddress: networkSettingsForm.macAddress,
};
// If DHCP disabled, update static DNS or static ipv4
@@ -99,14 +99,14 @@ const NetworkSettingsStore = {
.then(() => {
return i18n.t('pageNetworkSettings.toast.successSaveNetworkSettings');
})
- .catch(error => {
+ .catch((error) => {
console.log(error);
throw new Error(
i18n.t('pageNetworkSettings.toast.errorSaveNetworkSettings')
);
});
- }
- }
+ },
+ },
};
export default NetworkSettingsStore;