mirror of
https://github.com/gosticks/web.git
synced 2026-10-05 14:16:57 +00:00
Change the "recommended" servers to "preconfigured" servers
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -13,10 +13,11 @@ import PropTypes from "prop-types";
|
||||
import { Button, InputGroup, InputGroupAddon, ListGroupItem } from "reactstrap";
|
||||
import { Typeahead } from "react-bootstrap-typeahead";
|
||||
import { translate } from "react-i18next";
|
||||
import { preconfiguredUpstreamOptions } from "./preconfiguredUpstreams";
|
||||
|
||||
/**
|
||||
* A component to add upstream DNS servers. The servers are either selected from
|
||||
* a list of recommended upstreams, or custom servers can be input.
|
||||
* a list of preconfigured upstreams, or custom servers can be input.
|
||||
*/
|
||||
class DnsListNewItem extends Component {
|
||||
static propTypes = {
|
||||
@@ -31,7 +32,7 @@ class DnsListNewItem extends Component {
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the currently selected upstream address (either custom or recommended)
|
||||
* Get the currently selected upstream address (either custom or preconfigured)
|
||||
*
|
||||
* @returns {string} the selected upstream address
|
||||
*/
|
||||
@@ -54,7 +55,7 @@ class DnsListNewItem extends Component {
|
||||
<Typeahead
|
||||
onInputChange={address => this.setState({ address })}
|
||||
onChange={selected => this.setState({ selected })}
|
||||
options={recommendedUpstreamOptions.filter(
|
||||
options={preconfiguredUpstreamOptions.filter(
|
||||
upstream => !this.props.upstreams.includes(upstream.address)
|
||||
)}
|
||||
selected={this.state.selected}
|
||||
|
||||
+5
-5
@@ -3,16 +3,16 @@
|
||||
* Network-wide ad blocking via your own hardware.
|
||||
*
|
||||
* Web Interface
|
||||
* Recommended Upstream DNS Servers
|
||||
* Preconfigured Upstream DNS Servers
|
||||
*
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/**
|
||||
* A list of recommended upstream DNS servers. Each item has primary and
|
||||
* A list of preconfigured upstream DNS servers. Each item has primary and
|
||||
* secondary IPv4 and IPv6 server entries. Some addresses may be empty.
|
||||
*/
|
||||
export const recommendedUpstreams = [
|
||||
export const preconfiguredUpstreams = [
|
||||
{
|
||||
name: "OpenDNS (ECS)",
|
||||
primaryIpv4: "208.67.222.222",
|
||||
@@ -79,10 +79,10 @@ export const recommendedUpstreams = [
|
||||
];
|
||||
|
||||
/**
|
||||
* The recommended servers, but with an entry for each address. This is used
|
||||
* The preconfigured servers, but with an entry for each address. This is used
|
||||
* when displaying the servers in a list.
|
||||
*/
|
||||
export const recommendedUpstreamOptions = recommendedUpstreams.flatMap(
|
||||
export const preconfiguredUpstreamOptions = preconfiguredUpstreams.flatMap(
|
||||
upstream => {
|
||||
// Parse the upstream address information into the new format
|
||||
const parseUpstream = (address, order, type) => ({
|
||||
Reference in New Issue
Block a user