diff --git a/src/components/settings/DHCPInfo.js b/src/components/settings/DHCPInfo.js index 9d27238..cdb2f68 100644 --- a/src/components/settings/DHCPInfo.js +++ b/src/components/settings/DHCPInfo.js @@ -67,25 +67,15 @@ class DHCPInfo extends Component { const { t } = this.props; return ( -
-
-
- -
-
-
-

{t("DHCP")}

-
-            {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()}
-
-
-
+
+        {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()}
+
); } } diff --git a/src/components/settings/DNSInfo.js b/src/components/settings/DNSInfo.js index 76c8ade..a977ca9 100644 --- a/src/components/settings/DNSInfo.js +++ b/src/components/settings/DNSInfo.js @@ -69,41 +69,31 @@ class DNSInfo extends Component { const { t } = this.props; return ( -
-
-
- -
+
+
+
+            
+ {t("Upstream DNS Servers")}:
+ {this.state.upstream_dns.map(item => item + "\n")}
+
-
-

{t("DNS")}

-
-
-
-                
- {t("Upstream DNS Servers")}:
- {this.state.upstream_dns.map(item => item + "\n")}
-
-
-
-
-                
- {t("Interface listening behavior")}: {this.state.options.listening_type}
- {t("Forward FQDNs only")}: {this.state.options.fqdn_required.toString()}
- {t("Only forward public reverse lookups")}:{this.state.options.bogus_priv.toString()}
- {t("Use DNSSEC")}: {this.state.options.dnssec.toString()} -
-
-
-
-                
- {t("Conditional Forwarding")}
- {t("Enabled")}: {this.state.conditional_forwarding.enabled.toString()}
- {t("Router IP")}: {this.state.conditional_forwarding.router_ip.toString()}
- {t("Local Domain Name")}: {this.state.conditional_forwarding.domain.toString()}
-
-
-
+
+
+            
+ {t("Interface listening behavior")}: {this.state.options.listening_type}
+ {t("Forward FQDNs only")}: {this.state.options.fqdn_required.toString()}
+ {t("Only forward public reverse lookups")}:{this.state.options.bogus_priv.toString()}
+ {t("Use DNSSEC")}: {this.state.options.dnssec.toString()} +
+
+
+
+            
+ {t("Conditional Forwarding")}
+ {t("Enabled")}: {this.state.conditional_forwarding.enabled.toString()}
+ {t("Router IP")}: {this.state.conditional_forwarding.router_ip.toString()}
+ {t("Local Domain Name")}: {this.state.conditional_forwarding.domain.toString()}
+
); diff --git a/src/components/settings/FTLInfo.js b/src/components/settings/FTLInfo.js index e5c630e..a332817 100644 --- a/src/components/settings/FTLInfo.js +++ b/src/components/settings/FTLInfo.js @@ -56,23 +56,11 @@ class FTLInfo extends Component { const { t } = this.props; return ( -
-
-
- -
-
-
-

- {t("FTL Database")} -

-
-            {t("Queries")}: {this.state.queries}
- {t("Filesize")}: {this.state.filesize} B
- {t("SQLite version")}: {this.state.sqlite_version}
-
-
-
+
+        {t("Queries")}: {this.state.queries}
+ {t("Filesize")}: {this.state.filesize} B
+ {t("SQLite version")}: {this.state.sqlite_version}
+
); } } diff --git a/src/components/settings/NetworkInfo.js b/src/components/settings/NetworkInfo.js index 1fc7c90..2a39e8d 100644 --- a/src/components/settings/NetworkInfo.js +++ b/src/components/settings/NetworkInfo.js @@ -8,9 +8,10 @@ * This file is copyright under the latest version of the EUPL. * Please see LICENSE file for your rights under this license. */ -import React, { Component } from "react"; +import React, { Component, Fragment } from "react"; import { translate } from "react-i18next"; import { api, ignoreCancel, makeCancelable } from "../../utils"; +import { Col, Form, FormGroup, Input, Label } from "reactstrap"; class NetworkInfo extends Component { state = { @@ -58,22 +59,34 @@ class NetworkInfo extends Component { const { t } = this.props; return ( -
-
-
- -
-
-
-

{t("Network")}

-
-            {t("Interface")}: {this.state.interface}
- {t("IPv4 address")}: {this.state.ipv4_address}
- {t("IPv6 address")}: {this.state.ipv6_address}
- {t("Hostname")}: {this.state.hostname} -
-
-
+ +
+ + + + {this.state.interface} + + + + + + {this.state.ipv4_address} + + + + + + {this.state.ipv6_address} + + + + + + {this.state.hostname} + + +
+
); } } diff --git a/src/views/Networking.js b/src/views/Networking.js index 75ae64c..80547ac 100644 --- a/src/views/Networking.js +++ b/src/views/Networking.js @@ -8,30 +8,78 @@ * This file is copyright under the latest version of the EUPL. * Please see LICENSE file for your rights under this license. */ -import React from 'react'; +import React, { Component } from "react"; +import { translate } from "react-i18next"; +import { Nav, NavItem, NavLink, TabContent, TabPane } from "reactstrap"; +import DHCPInfo from "../components/settings/DHCPInfo"; +import DNSInfo from "../components/settings/DNSInfo"; +import NetworkInfo from "../components/settings/NetworkInfo"; +import FTLInfo from "../components/settings/FTLInfo"; -import DHCPInfo from '../components/settings/DHCPInfo'; -import DNSInfo from '../components/settings/DNSInfo'; -import NetworkInfo from '../components/settings/NetworkInfo'; -import FTLInfo from '../components/settings/FTLInfo'; +class Networking extends Component { + state = { + activeTab: "network" + }; -export default () => ( -
-
-
-
- -
-
- -
-
- -
-
- -
+ /** + * Set the active tab to the input + * + * @param tab the tab ID to switch to + */ + setTab = tab => { + if(this.state.activeTab !== tab) { + this.setState({ + activeTab: tab + }); + } + }; + + /** + * Create a navigation tab + * + * @param id the tab's ID + * @param name the tab's display name + * @returns {NavItem} the tab component + */ + tab = (id, name) => ( + + this.setTab(id)}> + {name} + + + ); + + /** + * Create tab content + * + * @param id the tab's ID + * @param component the component to render in the tab + * @returns {TabPane} the tab content component + */ + tabContent = (id, component) => ( + {component} + ); + + render() { + const { t } = this.props; + + return ( +
+ + + {this.tabContent("network", )} + {this.tabContent("dhcp", )} + {this.tabContent("dns", )} + {this.tabContent("ftl", )} +
-
-
-); + ); + } +} + +export default translate(["common", "settings"])(Networking);