diff --git a/src/components/DHCPInfo.js b/src/components/DHCPInfo.js
index 9757b3f..0156753 100644
--- a/src/components/DHCPInfo.js
+++ b/src/components/DHCPInfo.js
@@ -3,7 +3,7 @@
* Network-wide ad blocking via your own hardware.
*
* Web Interface
-* Settings :: DHCP Information
+* Settings :: DHCP
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
@@ -14,13 +14,13 @@ import { api, makeCancelable } from '../utils';
class DHCPInfo extends Component {
state = {
- active: "---",
- ip_start: "---",
- ip_end: "---",
- router_ip: "---",
- lease_time: "---",
- domain: "---",
- ipv6_support: "---"
+ active: "---",
+ ip_start: "---",
+ ip_end: "---",
+ router_ip: "---",
+ lease_time: "---",
+ domain: "---",
+ ipv6_support: "---"
}
constructor(props) {
@@ -41,19 +41,20 @@ class DHCPInfo extends Component {
ipv6_support: res.ipv6_support
})
})
- .catch((err) => {
- if(!err.isCanceled) {
- this.setState({
- active: "-!-",
- ip_start: "-!-",
- ip_end: "-!-",
- router_ip: "-!-",
- lease_time: "-!-",
- domain: "-!-",
- ipv6_support: "-!-"
- });
+ .catch((err) => {
+ if(!err.isCanceled) {
+ this.setState({
+ active: "-!-",
+ ip_start: "-!-",
+ ip_end: "-!-",
+ router_ip: "-!-",
+ lease_time: "-!-",
+ domain: "-!-",
+ ipv6_support: "-!-"
+ });
+ }
}
- });
+ );
}
componentDidMount() {
@@ -65,6 +66,8 @@ class DHCPInfo extends Component {
}
render() {
+ const { t } = this.props;
+
return (
@@ -73,15 +76,15 @@ class DHCPInfo extends Component {
-
DHCP Information
+
{t("DHCP Information")}
- DHCP Active: {this.state.active.toString()}
- Start IP: {this.state.ip_start}
- End IP: {this.state.ip_end}
- Router IP: {this.state.router_ip}
- Lease Time: {this.state.lease_time} h
- Domain: {this.state.domain}
- IPv6 Supported: {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 Supported")}: {this.state.ipv6_support.toString()}
diff --git a/src/components/DNSInfo.js b/src/components/DNSInfo.js
index 5d5ac18..853a549 100644
--- a/src/components/DNSInfo.js
+++ b/src/components/DNSInfo.js
@@ -3,7 +3,7 @@
* Network-wide ad blocking via your own hardware.
*
* Web Interface
-* Settings :: DHCP Information
+* Settings :: DHCP
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
@@ -14,19 +14,19 @@ import { api, makeCancelable } from '../utils';
class DNSInfo extends Component {
state = {
- "conditional_forwarding": {
- "enabled": "---",
- "router_ip": "---",
- "domain": "---"
- },
- "options": {
- "fqdn_required": "---",
- "bogus_priv": "---",
- "dnssec": "---",
- "listening_type": "---",
- },
- "upstream_dns": [ "---" ]
- }
+ "upstream_dns": [ "---" ],
+ "conditional_forwarding": {
+ "enabled": "---",
+ "router_ip": "---",
+ "domain": "---"
+ },
+ "options": {
+ "fqdn_required": "---",
+ "bogus_priv": "---",
+ "dnssec": "---",
+ "listening_type": "---",
+ },
+ };
constructor(props) {
super(props);
@@ -38,24 +38,25 @@ class DNSInfo extends Component {
this.updateHandler.promise.then(res => {
this.setState(res)
})
- .catch((err) => {
- if(!err.isCanceled) {
- this.setState({
- "upstream_dns": [ "-!-" ],
- "options": {
- "fqdn_required": "-!-",
- "bogus_priv": "-!-",
- "dnssec": "-!-",
- "listening_type": "-!-",
- },
- "conditional_forwarding": {
- "enabled": "-!-",
- "router_ip": "-!-",
- "domain": "-!-",
- }
- });
+ .catch((err) => {
+ if(!err.isCanceled) {
+ this.setState({
+ "upstream_dns": [ "-!-" ],
+ "options": {
+ "fqdn_required": "-!-",
+ "bogus_priv": "-!-",
+ "dnssec": "-!-",
+ "listening_type": "-!-",
+ },
+ "conditional_forwarding": {
+ "enabled": "-!-",
+ "router_ip": "-!-",
+ "domain": "-!-",
+ }
+ });
+ }
}
- });
+ );
}
componentDidMount() {
@@ -67,6 +68,8 @@ class DNSInfo extends Component {
}
render() {
+ const { t } = this.props;
+
return (
@@ -75,32 +78,31 @@ class DNSInfo extends Component {
-
DNS Information
+
{t("DNS Information")}
- Upstream DNS Servers:
- {this.state.upstream_dns.toString().replace(/,/g , "\n")}
-
+ {t("Upstream DNS Servers")}:
+ {this.state.upstream_dns.map(item => item + "\n")}
- Interfaces listening on: {this.state.options.listening_type}
- Forward FQDNs only: {this.state.options.fqdn_required.toString()}
- Private range privacy: {this.state.options.bogus_priv.toString()}
- Use DNSSEC: {this.state.options.dnssec.toString()}
+ {t("Interfaces listening on")}: {this.state.options.listening_type}
+ {t("Forward FQDNs only")}: {this.state.options.fqdn_required.toString()}
+ {t("Private range privacy")}: {this.state.options.bogus_priv.toString()}
+ {t("Use DNSSEC")}: {this.state.options.dnssec.toString()}
- Conditional Forwarding
- Enabled: {this.state.conditional_forwarding.enabled.toString()}
- Router IP: {this.state.conditional_forwarding.router_ip.toString()}
- Local Domain Name: {this.state.conditional_forwarding.domain.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/FTLInfo.js b/src/components/FTLInfo.js
old mode 100755
new mode 100644
index 6428299..34d2182
--- a/src/components/FTLInfo.js
+++ b/src/components/FTLInfo.js
@@ -14,10 +14,10 @@ import { api, makeCancelable } from '../utils';
class FTLInfo extends Component {
state = {
- filesize: "---",
- queries: "---",
- sqlite_version: "---"
- }
+ filesize: "---",
+ queries: "---",
+ sqlite_version: "---"
+ };
constructor(props) {
super(props);
@@ -33,15 +33,16 @@ class FTLInfo extends Component {
sqlite_version: res.sqlite_version
});
})
- .catch((err) => {
- if(!err.isCanceled) {
- this.setState({
- queries: "-!-",
- filesize: "-!-",
- sqlite_version: "-!-"
- });
+ .catch((err) => {
+ if(!err.isCanceled) {
+ this.setState({
+ queries: "-!-",
+ filesize: "-!-",
+ sqlite_version: "-!-"
+ });
+ }
}
- });
+ );
}
componentDidMount() {
@@ -53,6 +54,8 @@ class FTLInfo extends Component {
}
render() {
+ const { t } = this.props;
+
return (
@@ -61,11 +64,13 @@ class FTLInfo extends Component {
-
FTL Database Information
+
+ {t("FTL Database Information")}
+
- Queries: {this.state.queries}
- Filesize: {this.state.filesize} B
- 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/NetworkInfo.js b/src/components/NetworkInfo.js
index 824ac0a..635f403 100644
--- a/src/components/NetworkInfo.js
+++ b/src/components/NetworkInfo.js
@@ -3,7 +3,7 @@
* Network-wide ad blocking via your own hardware.
*
* Web Interface
-* Settings :: Network Information component
+* Settings :: Network component
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
@@ -14,11 +14,11 @@ import { api, makeCancelable } from '../utils';
class NetworkInfo extends Component {
state = {
- interface: "---",
- ipv4_address: "---",
- ipv6_address: "---",
- hostname: "---"
- }
+ interface: "---",
+ ipv4_address: "---",
+ ipv6_address: "---",
+ hostname: "---"
+ };
constructor(props) {
super(props);
@@ -35,16 +35,17 @@ class NetworkInfo extends Component {
hostname: res.hostname
})
})
- .catch((err) => {
- if(!err.isCanceled) {
- this.setState({
- interface: "-!-",
- ipv4_address: "-!-",
- ipv6_address: "-!-",
- hostname: "-!-"
- });
+ .catch((err) => {
+ if(!err.isCanceled) {
+ this.setState({
+ interface: "-!-",
+ ipv4_address: "-!-",
+ ipv6_address: "-!-",
+ hostname: "-!-"
+ });
+ }
}
- });
+ );
}
componentDidMount() {
@@ -56,6 +57,8 @@ class NetworkInfo extends Component {
}
render() {
+ const { t } = this.props;
+
return (
@@ -64,12 +67,12 @@ class NetworkInfo extends Component {
-
Network Information
+
{t("Network Information")}
- Interface: {this.state.interface}
- IPv4 address: {this.state.ipv4_address}
- IPv6 address: {this.state.ipv6_address}
- Hostname: {this.state.hostname}
+ {t("Interface")}: {this.state.interface}
+ {t("IPv4 address")}: {this.state.ipv4_address}
+ {t("IPv6 address")}: {this.state.ipv6_address}
+ {t("Hostname")}: {this.state.hostname}
diff --git a/src/components/VersionCard.js b/src/components/VersionCard.js
index cc50db9..0429363 100644
--- a/src/components/VersionCard.js
+++ b/src/components/VersionCard.js
@@ -8,33 +8,28 @@
* 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 from 'react';
import { translate } from 'react-i18next';
import PropTypes from 'prop-types';
-class VersionCard extends Component {
-
- render() {
- return (
-
+const VersionCard = props => (
+
-
{this.props.name}
+
{props.name}
- Branch: {this.props.branch}
- Hash: {this.props.hash}
- Tag: {this.props.tag}
+ {props.t("Branch")}: {props.branch}
+ {props.t("Hash")}: {props.hash}
+ {props.t("Tag")}: {props.tag}
- );
- }
-}
+ )
VersionCard.propTypes = {
branch : PropTypes.string,
diff --git a/src/components/VersionInfo.js b/src/components/VersionInfo.js
index c6c7763..2eb5da4 100644
--- a/src/components/VersionInfo.js
+++ b/src/components/VersionInfo.js
@@ -47,32 +47,33 @@ class Versions extends Component {
this.updateHandler.promise.then(res => {
this.setState(res);
})
- .catch((err) => {
- if(!err.isCanceled) {
- this.setState({
- api: {
- branch: "-!-",
- hash: "-!-",
- tag: "-!-"
- },
- core: {
- branch: "-!-",
- hash: "-!-",
- tag: "-!-"
- },
- ftl: {
- branch: "-!-",
- hash: "-!-",
- tag: "-!-"
- },
- web: {
- branch: "-!-",
- hash: "-!-",
- tag: "-!-"
- }
- });
+ .catch((err) => {
+ if(!err.isCanceled) {
+ this.setState({
+ api: {
+ branch: "-!-",
+ hash: "-!-",
+ tag: "-!-"
+ },
+ core: {
+ branch: "-!-",
+ hash: "-!-",
+ tag: "-!-"
+ },
+ ftl: {
+ branch: "-!-",
+ hash: "-!-",
+ tag: "-!-"
+ },
+ web: {
+ branch: "-!-",
+ hash: "-!-",
+ tag: "-!-"
+ }
+ });
+ }
}
- });
+ );
}
componentDidMount() {
@@ -84,23 +85,25 @@ class Versions extends Component {
}
render() {
+ const { t } = this.props;
+
return (
);