mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-21 22:39:11 +00:00
Added more items to dns settings
This commit is contained in:
parent
e284e95c23
commit
977233f28a
5 changed files with 308 additions and 4 deletions
|
@ -424,5 +424,16 @@
|
|||
"fastestIpAddress": "Fastest IP address",
|
||||
"loadBalancingDescription": "Query one upstream server at a time. AdGuard Home uses its weighted random algorithm to pick the server so that the fastest server is used more often.",
|
||||
"parallelRequestsDescription": "Use parallel queries to speed up resolving by querying all upstream servers simultaneously.",
|
||||
"fastestIpAddressDescription": "Query all DNS servers and return the fastest IP address among all responses. This slows down DNS queries as AdGuard Home has to wait for responses from all DNS servers, but improves the overall connectivity."
|
||||
"fastestIpAddressDescription": "Query all DNS servers and return the fastest IP address among all responses. This slows down DNS queries as AdGuard Home has to wait for responses from all DNS servers, but improves the overall connectivity.",
|
||||
"noBootstrapDns": "No bootstrap DNS servers added.",
|
||||
"bootstrapDnsServersInfo": "Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams.",
|
||||
"privateReverseDnsServers": "Private reverse DNS servers",
|
||||
"privateReverseDnsServersDescription": "The DNS servers that AdGuard Home uses for local PTR queries. These servers are used to resolve PTR requests for addresses in private IP ranges, for example \"192.168.12.34\", using reverse DNS. If not set, AdGuard Home uses the addresses of the default DNS resolvers of your OS except for the addresses of AdGuard Home itself.",
|
||||
"reverseDnsDefault": "By default, AdGuard Home uses the following reverse DNS resolvers",
|
||||
"addItem": "Add item",
|
||||
"noServerAddressesAdded": "No server addresses added.",
|
||||
"usePrivateReverseDnsResolvers": "Use private reverse DNS resolvers",
|
||||
"usePrivateReverseDnsResolversDescription": "Perform reverse DNS lookups for locally served addresses using these upstream servers. If disabled, AdGuard Home responds with NXDOMAIN to all such PTR requests except for clients known from DHCP, /etc/hosts, and so on.",
|
||||
"enableReverseResolving": "Enable reverse resolving of clients' IP addresses",
|
||||
"enableReverseResolvingDescription": "Reversely resolve clients' IP addresses into their hostnames by sending PTR queries to corresponding resolvers (private DNS servers for local clients, upstream servers for clients with public IP addresses)."
|
||||
}
|
|
@ -424,5 +424,16 @@
|
|||
"fastestIpAddress": "Dirección IP más rápida",
|
||||
"loadBalancingDescription": "Consulta un servidor DNS de subida a la vez. AdGuard Home utiliza su algoritmo aleatorio ponderado para elegir el servidor más rápido y sea utilizado con más frecuencia.",
|
||||
"parallelRequestsDescription": "Usar consultas paralelas para acelerar la resolución al consultar simultáneamente a todos los servidores DNS de subida.",
|
||||
"fastestIpAddressDescription": "Consulta todos los servidores DNS y devuelve la dirección IP más rápida de todas las respuestas. Esto ralentiza las consultas DNS ya que AdGuard Home tiene que esperar las respuestas de todos los servidores DNS, pero mejora la conectividad general."
|
||||
"fastestIpAddressDescription": "Consulta todos los servidores DNS y devuelve la dirección IP más rápida de todas las respuestas. Esto ralentiza las consultas DNS ya que AdGuard Home tiene que esperar las respuestas de todos los servidores DNS, pero mejora la conectividad general.",
|
||||
"noBootstrapDns": "No hay servidores DNS de arranque añadidos.",
|
||||
"bootstrapDnsServersInfo": "Los servidores DNS de arranque se utilizan para resolver las direcciones IP de los resolutores DoH/DoT que especifiques como DNS de subida.",
|
||||
"privateReverseDnsServers": "Servidores DNS privados e inversos",
|
||||
"privateReverseDnsServersDescription": "Los servidores DNS que AdGuard Home utiliza para las consultas PTR locales. Estos servidores se utilizan para resolver las peticiones PTR de direcciones en rangos de IP privadas, por ejemplo \"192.168.12.34\", utilizando DNS inverso. Si no está establecido, AdGuard Home utilizará los resolutores DNS predeterminados de tu sistema operativo, excepto las direcciones del propio AdGuard Home.",
|
||||
"reverseDnsDefault": "Por defecto, AdGuard Home utiliza los siguientes resolutores DNS inversos",
|
||||
"addItem": "Añadir elemento",
|
||||
"noServerAddressesAdded": "No hay direcciones de servidores añadidas.",
|
||||
"usePrivateReverseDnsResolvers": "Usar resolutores DNS inversos y privados",
|
||||
"usePrivateReverseDnsResolversDescription": "Realiza búsquedas DNS inversas para direcciones servidas localmente utilizando estos servidores DNS de subida. Si está deshabilitado, AdGuard Home responderá con NXDOMAIN a todas las peticiones PTR de este tipo, excepto para los clientes conocidos por DHCP, /etc/hosts, etc.",
|
||||
"enableReverseResolving": "Habilitar la resolución inversa de las direcciones IP de clientes",
|
||||
"enableReverseResolvingDescription": "Resuelve de manera inversa las direcciones IP de los clientes a sus nombres de hosts enviando consultas PTR a los resolutores correspondientes (servidores DNS privados para clientes locales, servidores DNS de subida para clientes con direcciones IP públicas)."
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/widgets/custom_switch_list_tile.dart';
|
||||
import 'package:adguard_home_manager/screens/settings/section_label.dart';
|
||||
import 'package:adguard_home_manager/screens/settings/dns/dns_mode_modal.dart';
|
||||
|
||||
|
@ -18,6 +19,21 @@ class _DnsSettingsState extends State<DnsSettings> {
|
|||
|
||||
String upstreamMode = "load_balancing";
|
||||
|
||||
List<TextEditingController> bootstrapControllers = [
|
||||
TextEditingController()
|
||||
];
|
||||
|
||||
List<TextEditingController> privateControllers = [];
|
||||
|
||||
List<String> defaultReverseResolvers = ["80.58.61.250", "80.58.61.251"];
|
||||
bool editReverseResolvers = false;
|
||||
List<TextEditingController> reverseResolversControllers = [
|
||||
TextEditingController()
|
||||
];
|
||||
bool usePrivateReverseDnsResolvers = false;
|
||||
bool enableReverseResolve = false;
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void openDnsModalSheet() {
|
||||
|
@ -141,9 +157,208 @@ class _DnsSettingsState extends State<DnsSettings> {
|
|||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SectionLabel(label: AppLocalizations.of(context)!.bootstrapDns),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10),
|
||||
child: IconButton(
|
||||
onPressed: () => setState(() => bootstrapControllers.add(TextEditingController())),
|
||||
icon: const Icon(Icons.add)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Card(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 24, right: 24, bottom: 20
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.info_rounded),
|
||||
const SizedBox(width: 20),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width-132,
|
||||
child: Text(AppLocalizations.of(context)!.bootstrapDnsServersInfo)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
if (bootstrapControllers.isEmpty) Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noBootstrapDns,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
...bootstrapControllers.map((c) => Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24, right: 10, bottom: 20
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width-90,
|
||||
child: TextFormField(
|
||||
controller: c,
|
||||
// onChanged: (_) => checkValidValues(),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.dns_rounded),
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10)
|
||||
)
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.dnsServer,
|
||||
)
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => setState(() => bootstrapControllers = bootstrapControllers.where((con) => con != c).toList()),
|
||||
icon: const Icon(Icons.remove_circle_outline)
|
||||
)
|
||||
],
|
||||
),
|
||||
)).toList(),
|
||||
SectionLabel(label: AppLocalizations.of(context)!.privateReverseDnsServers),
|
||||
Card(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 24, right: 24, bottom: 10
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.info_rounded),
|
||||
const SizedBox(width: 20),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width-132,
|
||||
child: Text(AppLocalizations.of(context)!.privateReverseDnsServersDescription)
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (editReverseResolvers == false) ...[
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Text(
|
||||
"${AppLocalizations.of(context)!.reverseDnsDefault}:\n\n${defaultReverseResolvers.map((item) => item).join(', ').toString().replaceAll(RegExp(r'\(|\)'), '')}",
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 10, bottom: 20),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ElevatedButton.icon(
|
||||
onPressed: () => setState(() => editReverseResolvers = true),
|
||||
icon: const Icon(Icons.edit),
|
||||
label: Text(AppLocalizations.of(context)!.edit)
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
if (editReverseResolvers == true) ...[
|
||||
const SizedBox(height: 20),
|
||||
...reverseResolversControllers.map((c) => Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24, right: 10, bottom: 20
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width-90,
|
||||
child: TextFormField(
|
||||
controller: c,
|
||||
// onChanged: (_) => checkValidValues(),
|
||||
decoration: InputDecoration(
|
||||
prefixIcon: const Icon(Icons.dns_rounded),
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10)
|
||||
)
|
||||
),
|
||||
labelText: AppLocalizations.of(context)!.serverAddress,
|
||||
)
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () => setState(() => reverseResolversControllers = reverseResolversControllers.where((con) => con != c).toList()),
|
||||
icon: const Icon(Icons.remove_circle_outline)
|
||||
)
|
||||
],
|
||||
),
|
||||
)),
|
||||
if (reverseResolversControllers.isEmpty) Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 20, right: 20, bottom: 20
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
AppLocalizations.of(context)!.noServerAddressesAdded,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 16
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ElevatedButton.icon(
|
||||
onPressed: () => setState(() => reverseResolversControllers.add(TextEditingController())),
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(AppLocalizations.of(context)!.addItem)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
CustomSwitchListTile(
|
||||
value: usePrivateReverseDnsResolvers,
|
||||
onChanged: (value) => setState(() => usePrivateReverseDnsResolvers = value),
|
||||
title: AppLocalizations.of(context)!.usePrivateReverseDnsResolvers,
|
||||
subtitle: AppLocalizations.of(context)!.usePrivateReverseDnsResolversDescription
|
||||
),
|
||||
CustomSwitchListTile(
|
||||
value: enableReverseResolve,
|
||||
onChanged: (value) => setState(() => enableReverseResolve = value),
|
||||
title: AppLocalizations.of(context)!.enableReverseResolving,
|
||||
subtitle: AppLocalizations.of(context)!.enableReverseResolvingDescription
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -45,7 +45,6 @@ class CustomRadioListTile extends StatelessWidget {
|
|||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 16
|
||||
),
|
||||
),
|
||||
|
|
68
lib/widgets/custom_switch_list_tile.dart
Normal file
68
lib/widgets/custom_switch_list_tile.dart
Normal file
|
@ -0,0 +1,68 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomSwitchListTile extends StatelessWidget {
|
||||
final bool value;
|
||||
final void Function(bool) onChanged;
|
||||
final String title;
|
||||
final String? subtitle;
|
||||
|
||||
const CustomSwitchListTile({
|
||||
Key? key,
|
||||
required this.value,
|
||||
required this.onChanged,
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => onChanged(!value),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 20, left: 24, right: 10, bottom: 20
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width-110,
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (subtitle != null) ... [
|
||||
const SizedBox(height: 5),
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width-110,
|
||||
child: Text(
|
||||
subtitle!,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey
|
||||
),
|
||||
),
|
||||
),
|
||||
]
|
||||
],
|
||||
),
|
||||
Switch(
|
||||
value: value,
|
||||
onChanged: onChanged,
|
||||
activeColor: Theme.of(context).primaryColor,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue