From 1a5181fce060b115946fa938845d9fb9a38207f7 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 13 Oct 2018 17:47:47 -0400 Subject: [PATCH 01/12] Remove `` from NetworkInfo Signed-off-by: Mcat12 --- src/components/settings/NetworkInfo.js | 70 ++++++++++---------------- 1 file changed, 26 insertions(+), 44 deletions(-) diff --git a/src/components/settings/NetworkInfo.js b/src/components/settings/NetworkInfo.js index d4c7ce2..65d171d 100644 --- a/src/components/settings/NetworkInfo.js +++ b/src/components/settings/NetworkInfo.js @@ -63,50 +63,32 @@ class NetworkInfo extends Component { const { t } = this.props; return ( - -
- - - - - {this.state.interface} - - - - - - - - {this.state.ipv4_address} - - - - - - - - {this.state.ipv6_address} - - - - - - - - {this.state.hostname} - - - -
-
+
+ + + + {this.state.interface} + + + + + + {this.state.ipv4_address} + + + + + + {this.state.ipv6_address} + + + + + + {this.state.hostname} + + +
); } } From d8e0b26511fcee0ee3558fef9f4ec99a15f86047 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 13 Oct 2018 18:43:12 -0400 Subject: [PATCH 02/12] Convert DHCPInfo into a simple form setup Signed-off-by: Mcat12 --- src/components/settings/DHCPInfo.js | 62 ++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/src/components/settings/DHCPInfo.js b/src/components/settings/DHCPInfo.js index ddc9d4e..9e950c4 100644 --- a/src/components/settings/DHCPInfo.js +++ b/src/components/settings/DHCPInfo.js @@ -11,6 +11,7 @@ import React, { Component } from "react"; import { translate } from "react-i18next"; import { api, ignoreCancel, makeCancelable } from "../../utils"; +import { Col, Form, FormGroup, Input, InputGroup, InputGroupAddon, Label } from "reactstrap"; class DHCPInfo extends Component { state = { @@ -67,25 +68,56 @@ class DHCPInfo extends Component { this.updateHandler.cancel(); } + onChange = (key, attr) => { + return e => this.setState({ + [key]: e.target[attr] + }); + }; + render() { const { t } = this.props; return ( -
-        {t("DHCP Active")}: {this.state.active.toString()}
-        
- {t("Start IP")}: {this.state.ip_start} -
- {t("End IP")}: {this.state.ip_end} -
- {t("Router IP")}: {this.state.router_ip} -
- {t("Lease Time")}: {this.state.lease_time} h
- {t("Domain")}: {this.state.domain} -
- {t("IPv6 Support")}: {this.state.ipv6_support.toString()} -
-
+
+ + + + + + + + + + + + + + + + + + + + + Hours + + + + + + + + + + +
); } } From 71a4308800303f1c9d1f5652ec74e0a0b0f19096 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Mon, 15 Oct 2018 13:42:48 -0400 Subject: [PATCH 03/12] Disable DHCP settings when DHCP is not enabled Signed-off-by: Mcat12 --- src/components/settings/DHCPInfo.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/settings/DHCPInfo.js b/src/components/settings/DHCPInfo.js index 9e950c4..844c1d1 100644 --- a/src/components/settings/DHCPInfo.js +++ b/src/components/settings/DHCPInfo.js @@ -11,7 +11,7 @@ import React, { Component } from "react"; import { translate } from "react-i18next"; import { api, ignoreCancel, makeCancelable } from "../../utils"; -import { Col, Form, FormGroup, Input, InputGroup, InputGroupAddon, Label } from "reactstrap"; +import { Form, FormGroup, Input, InputGroup, InputGroupAddon, Label } from "reactstrap"; class DHCPInfo extends Component { state = { @@ -87,20 +87,20 @@ class DHCPInfo extends Component { - + - + - + - + Hours @@ -108,11 +108,11 @@ class DHCPInfo extends Component { - + From 2896baf075516178ec30514f8565c3f425286ec4 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Mon, 15 Oct 2018 13:46:56 -0400 Subject: [PATCH 04/12] Use a form grid for DHCP settings Signed-off-by: Mcat12 --- src/components/settings/DHCPInfo.js | 57 ++++++++++++++++---------- src/components/settings/NetworkInfo.js | 2 +- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/components/settings/DHCPInfo.js b/src/components/settings/DHCPInfo.js index 844c1d1..2b43e05 100644 --- a/src/components/settings/DHCPInfo.js +++ b/src/components/settings/DHCPInfo.js @@ -11,7 +11,7 @@ import React, { Component } from "react"; import { translate } from "react-i18next"; import { api, ignoreCancel, makeCancelable } from "../../utils"; -import { Form, FormGroup, Input, InputGroup, InputGroupAddon, Label } from "reactstrap"; +import { Col, Form, FormGroup, Input, InputGroup, InputGroupAddon, Label } from "reactstrap"; class DHCPInfo extends Component { state = { @@ -85,30 +85,45 @@ class DHCPInfo extends Component { Enabled - - - + + + + + - - - + + + + + - - - + + + + + - - - - - - Hours - - + + + + + + + Hours + + + - - - + + + + +