mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-04 20:30:35 +00:00
Added plain dns control
This commit is contained in:
parent
b977aed9bd
commit
3f057062f1
4 changed files with 25 additions and 2 deletions
|
@ -772,5 +772,7 @@
|
|||
"customRulesNotUpdated": "Custom rules could not be updated",
|
||||
"reorder": "Reorder",
|
||||
"showHide": "Show/hide",
|
||||
"noElementsReorderMessage": "Enable some elements on the show/hide tab to reorder them here."
|
||||
"noElementsReorderMessage": "Enable some elements on the show/hide tab to reorder them here.",
|
||||
"enablePlainDns": "Enable plain DNS",
|
||||
"enablePlainDnsDescription": "Plain DNS is enabled by default. You can disable it to force all devices to use encrypted DNS. To do this, you must enable at least one encrypted DNS protocol."
|
||||
}
|
|
@ -772,5 +772,7 @@
|
|||
"customRulesNotUpdated": "Las reglas personalizadas no pudieron ser actualizadas",
|
||||
"reorder": "Reordenar",
|
||||
"showHide": "Mostrar/ocultar",
|
||||
"noElementsReorderMessage": "Activa algunos elementos en la pestaña de mostrar/ocultar para reordenarlos aquí."
|
||||
"noElementsReorderMessage": "Activa algunos elementos en la pestaña de mostrar/ocultar para reordenarlos aquí.",
|
||||
"enablePlainDns": "Activar DNS simple (sin cifrado)",
|
||||
"enablePlainDnsDescription": "El DNS simple (sin cifrado) está activado de forma predeterminada. Puedes desactivarlo para obligar a todos los dispositivos a utilizar DNS cifrado. Para ello, debes habilitar al menos un protocolo DNS cifrado."
|
||||
}
|
|
@ -39,6 +39,7 @@ class EncryptionData {
|
|||
final String certificatePath;
|
||||
final String privateKeyPath;
|
||||
final bool privateKeySaved;
|
||||
final bool? servePlainDns;
|
||||
|
||||
EncryptionData({
|
||||
required this.validCert,
|
||||
|
@ -65,6 +66,7 @@ class EncryptionData {
|
|||
required this.certificatePath,
|
||||
required this.privateKeyPath,
|
||||
required this.privateKeySaved,
|
||||
required this.servePlainDns,
|
||||
});
|
||||
|
||||
|
||||
|
@ -93,6 +95,7 @@ class EncryptionData {
|
|||
certificatePath: json["certificate_path"],
|
||||
privateKeyPath: json["private_key_path"],
|
||||
privateKeySaved: json["private_key_saved"],
|
||||
servePlainDns: json["serve_plain_dns"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
@ -120,6 +123,7 @@ class EncryptionData {
|
|||
"certificate_path": certificatePath,
|
||||
"private_key_path": privateKeyPath,
|
||||
"private_key_saved": privateKeySaved,
|
||||
"serve_plain_dns": servePlainDns,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
import 'package:adguard_home_manager/widgets/custom_checkbox_list_tile.dart';
|
||||
import 'package:adguard_home_manager/widgets/section_label.dart';
|
||||
import 'package:adguard_home_manager/widgets/custom_switch_list_tile.dart';
|
||||
import 'package:adguard_home_manager/screens/settings/encryption/status.dart';
|
||||
|
@ -35,6 +36,8 @@ class _EncryptionSettingsState extends State<EncryptionSettings> {
|
|||
|
||||
bool enabled = false;
|
||||
|
||||
bool? _plainDns;
|
||||
|
||||
final TextEditingController domainNameController = TextEditingController();
|
||||
String? domainError;
|
||||
|
||||
|
@ -112,6 +115,7 @@ class _EncryptionSettingsState extends State<EncryptionSettings> {
|
|||
privateKeyPathController.text = data.privateKeyPath;
|
||||
}
|
||||
usePreviouslySavedKey = data.privateKeySaved;
|
||||
_plainDns = data.servePlainDns;
|
||||
loadStatus = LoadStatus.loaded;
|
||||
});
|
||||
}
|
||||
|
@ -224,6 +228,7 @@ class _EncryptionSettingsState extends State<EncryptionSettings> {
|
|||
"private_key_saved": usePreviouslySavedKey,
|
||||
"certificate_path": certificatePathController.text,
|
||||
"private_key_path": privateKeyPathController.text,
|
||||
"serve_plain_dns": _plainDns
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -271,6 +276,7 @@ class _EncryptionSettingsState extends State<EncryptionSettings> {
|
|||
"private_key_saved": false,
|
||||
"certificate_path": "",
|
||||
"private_key_path": "",
|
||||
"serve_plain_dns": true
|
||||
}
|
||||
);
|
||||
if (!mounted) return;
|
||||
|
@ -372,6 +378,15 @@ class _EncryptionSettingsState extends State<EncryptionSettings> {
|
|||
onEditValidate();
|
||||
}
|
||||
),
|
||||
if (_plainDns != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
CustomCheckboxListTile(
|
||||
value: _plainDns!,
|
||||
onChanged: (v) => setState(() => _plainDns = v),
|
||||
title: AppLocalizations.of(context)!.enablePlainDns,
|
||||
subtitle: AppLocalizations.of(context)!.enablePlainDnsDescription,
|
||||
),
|
||||
],
|
||||
SectionLabel(
|
||||
label: AppLocalizations.of(context)!.serverConfiguration,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue