Translate tags added

Code formatting

Signed-off-by: Rob Gill <rrobgill@protonmail.com>
This commit is contained in:
Rob Gill
2018-07-04 15:24:49 -04:00
committed by Mcat12
parent 8a611a627c
commit 6be8b9255e
6 changed files with 165 additions and 154 deletions
+31 -28
View File
@@ -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 (
<div className="card border-0 bg-success stat-dbl-height-lock">
<div className="card-body">
@@ -73,15 +76,15 @@ class DHCPInfo extends Component {
</div>
</div>
<div className="card-img-overlay">
<h3>DHCP Information</h3>
<h3>{t("DHCP Information")}</h3>
<pre>
DHCP Active: {this.state.active.toString()}<br/>
Start IP: {this.state.ip_start}<br/>
End IP: {this.state.ip_end}<br/>
Router IP: {this.state.router_ip}<br/>
Lease Time: {this.state.lease_time} h<br/>
Domain: {this.state.domain}<br/>
IPv6 Supported: {this.state.ipv6_support.toString()}<br/>
{t("DHCP Active")}: {this.state.active.toString()}<br/>
{t("Start IP")}: {this.state.ip_start}<br/>
{t("End IP")}: {this.state.ip_end}<br/>
{t("Router IP")}: {this.state.router_ip}<br/>
{t("Lease Time")}: {this.state.lease_time} h<br/>
{t("Domain")}: {this.state.domain}<br/>
{t("IPv6 Supported")}: {this.state.ipv6_support.toString()}<br/>
</pre>
</div>
</div>
+45 -43
View File
@@ -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 (
<div className="card border-0 bg-success stat-dbl-height-lock">
<div className="card-body">
@@ -75,32 +78,31 @@ class DNSInfo extends Component {
</div>
</div>
<div className="card-img-overlay">
<h3>DNS Information</h3>
<h3>{t("DNS Information")}</h3>
<div className="row">
<div className="col-lg-4 col-sm-4 col-xs-4">
<pre>
<br/>
Upstream DNS Servers:<br/>
{this.state.upstream_dns.toString().replace(/,/g , "\n")}<br/>
{t("Upstream DNS Servers")}:<br/>
{this.state.upstream_dns.map(item => item + "\n")}<br/>
</pre>
</div>
<div className="col-lg-4 col-sm-4 col-xs-4">
<pre>
<br/>
Interfaces listening on: {this.state.options.listening_type}<br/>
Forward FQDNs only: {this.state.options.fqdn_required.toString()} <br/>
Private range privacy: {this.state.options.bogus_priv.toString()}<br/>
Use DNSSEC: {this.state.options.dnssec.toString()}
{t("Interfaces listening on")}: {this.state.options.listening_type}<br/>
{t("Forward FQDNs only")}: {this.state.options.fqdn_required.toString()}<br/>
{t("Private range privacy")}: {this.state.options.bogus_priv.toString()}<br/>
{t("Use DNSSEC")}: {this.state.options.dnssec.toString()}
</pre>
</div>
<div className="col-lg-4 col-sm-4 col-xs-4">
<pre>
<br/>
Conditional Forwarding<br/>
Enabled: {this.state.conditional_forwarding.enabled.toString()} <br/>
Router IP: {this.state.conditional_forwarding.router_ip.toString()}<br/>
Local Domain Name: {this.state.conditional_forwarding.domain.toString()}<br/>
{t("Conditional Forwarding")}<br/>
{t("Enabled")}: {this.state.conditional_forwarding.enabled.toString()}<br/>
{t("Router IP")}: {this.state.conditional_forwarding.router_ip.toString()}<br/>
{t("Local Domain Name")}: {this.state.conditional_forwarding.domain.toString()}<br/>
</pre>
</div>
</div>
Executable → Regular
+21 -16
View File
@@ -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 (
<div className="card border-0 bg-success stat-dbl-height-lock">
<div className="card-block">
@@ -61,11 +64,13 @@ class FTLInfo extends Component {
</div>
</div>
<div className="card-img-overlay">
<h3>FTL Database Information</h3>
<h3>
{t("FTL Database Information")}
</h3>
<pre>
Queries: {this.state.queries}<br/>
Filesize: {this.state.filesize} B<br/>
SQLite version: {this.state.sqlite_version}<br/>
{t("Queries")}: {this.state.queries}<br/>
{t("Filesize")}: {this.state.filesize} B<br/>
{t("SQLite version")}: {this.state.sqlite_version}<br/>
</pre>
</div>
</div>
+23 -20
View File
@@ -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 (
<div className="card border-0 bg-success stat-dbl-height-lock">
<div className="card-block">
@@ -64,12 +67,12 @@ class NetworkInfo extends Component {
</div>
</div>
<div className="card-img-overlay">
<h3>Network Information</h3>
<h3>{t("Network Information")}</h3>
<pre>
Interface: {this.state.interface}<br/>
IPv4 address: {this.state.ipv4_address}<br/>
IPv6 address: {this.state.ipv6_address}<br/>
Hostname: {this.state.hostname}
{t("Interface")}: {this.state.interface}<br/>
{t("IPv4 address")}: {this.state.ipv4_address}<br/>
{t("IPv6 address")}: {this.state.ipv6_address}<br/>
{t("Hostname")}: {this.state.hostname}
</pre>
</div>
</div>
+9 -14
View File
@@ -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 (
<div className="card border-0 bg-primary stat-mid-height-lock">
const VersionCard = props => (
<div className="card border-0 bg-primary stat-mid-height-lock">
<div className="card-block">
<div className="card-icon">
<i className={this.props.icon}/>
<i className={props.icon}/>
</div>
</div>
<div className="card-img-overlay">
<h3>{this.props.name}</h3>
<h3>{props.name}</h3>
<pre>
<br/>
Branch: {this.props.branch}<br/>
Hash: {this.props.hash}<br/>
Tag: {this.props.tag}<br/>
{props.t("Branch")}: {props.branch}<br/>
{props.t("Hash")}: {props.hash}<br/>
{props.t("Tag")}: {props.tag}<br/>
</pre>
</div>
</div>
);
}
}
)
VersionCard.propTypes = {
branch : PropTypes.string,
+36 -33
View File
@@ -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 (
<div className="row">
<div className="col-lg-3 col-xs-12">
<VersionCard name="Core" icon="fa fa-dot-circle-o fa-2x"
branch={this.state.core.branch} hash={this.state.core.hash} tag={this.state.core.tag}/>
<VersionCard name={t("Core")} icon="fa fa-dot-circle-o fa-2x"
branch={this.state.core.branch} hash={this.state.core.hash} tag={this.state.core.tag} t={t}/>
</div>
<div className="col-lg-3 col-xs-12">
<VersionCard name="FTL" icon="fa fa-industry fa-2x"
branch={this.state.ftl.branch} hash={this.state.ftl.hash} tag={this.state.ftl.tag}/>
<VersionCard name={t("FTL")} icon="fa fa-industry fa-2x"
branch={this.state.ftl.branch} hash={this.state.ftl.hash} tag={this.state.ftl.tag} t={t}/>
</div>
<div className="col-lg-3 col-xs-12">
<VersionCard name="API" icon="fa fa-bullseye fa-2x"
branch={this.state.api.branch} hash={this.state.api.hash} tag={this.state.api.tag}/>
<VersionCard name={t("API")} icon="fa fa-bullseye fa-2x"
branch={this.state.api.branch} hash={this.state.api.hash} tag={this.state.api.tag} t={t}/>
</div>
<div className="col-lg-3 col-xs-12">
<VersionCard name="Web" icon="fa fa-list-alt fa-2x"
branch={this.state.web.branch} hash={this.state.web.hash} tag={this.state.web.tag}/>
<VersionCard name={t("Web")} icon="fa fa-list-alt fa-2x"
branch={this.state.web.branch} hash={this.state.web.hash} tag={this.state.web.tag} t={t}/>
</div>
</div>
);