From 157d2ffe6175e5849c7137dabdb05dd5b50ed372 Mon Sep 17 00:00:00 2001 From: Dixsie Wolmers Date: Wed, 16 Dec 2020 14:25:04 -0600 Subject: Add DHCP enable to Network Settings page - Adds ability to disable or enable DHCP from UI. - Displays DHCP addresses in table. - Displays only Static addresses in Static table Note for testing: - If BMC does not have a DHCP server on the network when enabling DHCP then system will go down (no IP addresses will be available) Signed-off-by: Dixsie Wolmers Change-Id: I4a9e6e13a80bcac8233e4382c0f4accc59c8adb8 --- src/locales/en-US.json | 20 ++- .../modules/Configuration/NetworkSettingsStore.js | 3 + .../NetworkSettings/NetworkSettings.vue | 154 ++++++++++++++++++--- 3 files changed, 153 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/locales/en-US.json b/src/locales/en-US.json index ed2495c5..a4af7091 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -562,16 +562,15 @@ "serverPowCapSetting": "Server power cap setting" }, "pageNetworkSettings": { + "dhcp": "DHCP", + "ipv4": "IPV4", + "ipv4Configuration": "IPV4 configuration", + "ipv4Helper": "An IP address must be available to enable DHCP or Static configuration", "interface": "Interface", - "pageDescription": "Configure network settings for the BMC and the Virtualization management interface", + "pageDescription": "Configure network settings for the BMC", + "static": "Static", "staticDns": "Static DNS", - "staticIpv4": "Static IPv4", "system": "System", - "ariaLabel": { - "staticDnsRow": "Static DNS address", - "staticIpv4AddressRow": "Static IPv4 address", - "staticIpv4SubnetRow": "Static IPV4 subnet" - }, "form": { "defaultGateway": "Default gateway", "hostname": "Hostname", @@ -582,11 +581,18 @@ "addDns": "Add DNS server", "addStaticIpv4Address": "Add static IP", "deleteDns": "Delete DNS row", + "deleteDHCPIpv4": "Delete IPv4 row", "deleteStaticIpv4": "Delete IPv4 row", + "dhcpIpv4AddressRow": "DHCP IPv4 address", + "dhcpIpv4SubnetRow": "DHCP IPV4 subnet", "ipAddress": "IP address", + "staticDnsRow": "Static DNS address", + "staticIpv4AddressRow": "Static IPv4 address", + "staticIpv4SubnetRow": "Static IPV4 subnet", "subnet": "Subnet mask" }, "toast": { + "errorSaveDhcpSettings": "Error enabling DHCP configuration.", "errorSaveNetworkSettings": "Error saving network settings.", "successSaveNetworkSettings": "Successfully saved network settings." } diff --git a/src/store/modules/Configuration/NetworkSettingsStore.js b/src/store/modules/Configuration/NetworkSettingsStore.js index 9cdcd415..159c5bf6 100644 --- a/src/store/modules/Configuration/NetworkSettingsStore.js +++ b/src/store/modules/Configuration/NetworkSettingsStore.js @@ -82,6 +82,9 @@ const NetworkSettingsStore = { const data = { HostName: networkSettingsForm.hostname, MACAddress: networkSettingsForm.macAddress, + DHCPv4: { + DHCPEnabled: networkSettingsForm.isDhcpEnabled, + }, }; // If DHCP disabled, update static DNS or static ipv4 diff --git a/src/views/Configuration/NetworkSettings/NetworkSettings.vue b/src/views/Configuration/NetworkSettings/NetworkSettings.vue index 4cf0f83d..f007a94c 100644 --- a/src/views/Configuration/NetworkSettings/NetworkSettings.vue +++ b/src/views/Configuration/NetworkSettings/NetworkSettings.vue @@ -35,7 +35,6 @@ v-model.trim="form.gateway" data-test-id="networkSettings-input-gateway" type="text" - :readonly="dhcpEnabled" :state="getValidationState($v.form.gateway)" @change="$v.form.gateway.$touch()" /> @@ -99,26 +98,106 @@ - + + + + {{ $t('pageNetworkSettings.ipv4Helper') }} + + + {{ $t('pageNetworkSettings.dhcp') }} + + + {{ $t('pageNetworkSettings.static') }} + + +

+ {{ $t('pageNetworkSettings.dhcp') }} +

+ + + + + +
+ +

+ {{ $t('pageNetworkSettings.static') }} +