mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-15 22:42:50 +00:00
Fixed issue add identifier and upstream servers clients screen
This commit is contained in:
parent
7097ab9d15
commit
7fc68ec8c6
2 changed files with 36 additions and 19 deletions
|
@ -358,7 +358,7 @@
|
||||||
"seconds": "segundos",
|
"seconds": "segundos",
|
||||||
"leaseTimeNotValid": "Tiempo de asignación no válido",
|
"leaseTimeNotValid": "Tiempo de asignación no válido",
|
||||||
"restoreConfiguration": "Restaurar configuración",
|
"restoreConfiguration": "Restaurar configuración",
|
||||||
"restoreConfigurationMessage": "Estás seguro de que deseas continuar? Se reseteará toda la configuración. Esta acción no se puede deshacer.",
|
"restoreConfigurationMessage": "¿Estás seguro de que deseas continuar? Se reseteará toda la configuración. Esta acción no se puede deshacer.",
|
||||||
"changeInterface": "Cambiar interfaz",
|
"changeInterface": "Cambiar interfaz",
|
||||||
"savingSettings": "Guardando configuración...",
|
"savingSettings": "Guardando configuración...",
|
||||||
"settingsSaved": "Configuración guardada correctamente",
|
"settingsSaved": "Configuración guardada correctamente",
|
||||||
|
@ -384,7 +384,7 @@
|
||||||
"staticLeaseExists": "La asignación DHCP estática ya existe",
|
"staticLeaseExists": "La asignación DHCP estática ya existe",
|
||||||
"serverNotConfigured": "El servidor no está configurado",
|
"serverNotConfigured": "El servidor no está configurado",
|
||||||
"restoreLeases": "Restaurar asignaciones",
|
"restoreLeases": "Restaurar asignaciones",
|
||||||
"restoreLeasesMessage": "Estás seguro de que deseas continuar? Se resetearán todas las asignaciones estáticas configuradas. Esta acción no se puede deshacer",
|
"restoreLeasesMessage": "¿Estás seguro de que deseas continuar? Se resetearán todas las asignaciones estáticas configuradas. Esta acción no se puede deshacer",
|
||||||
"restoringLeases": "Restaurando asignaciones...",
|
"restoringLeases": "Restaurando asignaciones...",
|
||||||
"leasesRestored": "Asignaciones restauradas correctamente",
|
"leasesRestored": "Asignaciones restauradas correctamente",
|
||||||
"leasesNotRestored": "Las asignaciones no pudieron ser restauradas",
|
"leasesNotRestored": "Las asignaciones no pudieron ser restauradas",
|
||||||
|
|
|
@ -113,9 +113,12 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
widget.onConfirm(client);
|
widget.onConfirm(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget sectionLabel(String label) {
|
Widget sectionLabel({
|
||||||
|
required String label,
|
||||||
|
EdgeInsets? padding
|
||||||
|
}) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: padding ?? const EdgeInsets.symmetric(
|
||||||
vertical: 24,
|
vertical: 24,
|
||||||
horizontal: 24
|
horizontal: 24
|
||||||
),
|
),
|
||||||
|
@ -309,7 +312,7 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
sectionLabel(AppLocalizations.of(context)!.tags),
|
sectionLabel(label: AppLocalizations.of(context)!.tags),
|
||||||
Material(
|
Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
|
@ -354,21 +357,28 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
sectionLabel(AppLocalizations.of(context)!.identifiers),
|
sectionLabel(
|
||||||
|
label: AppLocalizations.of(context)!.identifiers,
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 24, right: 24, top: 24, bottom: 12
|
||||||
|
)
|
||||||
|
),
|
||||||
if (editMode == true) Padding(
|
if (editMode == true) Padding(
|
||||||
padding: const EdgeInsets.only(right: 20),
|
padding: const EdgeInsets.only(right: 20),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () => setState(() => identifiersControllers.add({
|
onPressed: () => setState(() => identifiersControllers.add(
|
||||||
'id': uuid.v4(),
|
Map<String, Object>.from({
|
||||||
'controller': TextEditingController()
|
'id': uuid.v4(),
|
||||||
})),
|
'controller': TextEditingController()
|
||||||
|
})
|
||||||
|
)),
|
||||||
icon: const Icon(Icons.add)
|
icon: const Icon(Icons.add)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (identifiersControllers.isNotEmpty) ...identifiersControllers.map((controller) => Padding(
|
if (identifiersControllers.isNotEmpty) ...identifiersControllers.map((controller) => Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
@ -415,7 +425,12 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
sectionLabel(AppLocalizations.of(context)!.settings),
|
sectionLabel(
|
||||||
|
label: AppLocalizations.of(context)!.settings,
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 24, right: 24, top: 12, bottom: 24
|
||||||
|
)
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Material(
|
child: Material(
|
||||||
|
@ -483,7 +498,7 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
? (value) => setState(() => enableSafeSearch = value)
|
? (value) => setState(() => enableSafeSearch = value)
|
||||||
: null
|
: null
|
||||||
),
|
),
|
||||||
sectionLabel(AppLocalizations.of(context)!.blockedServices),
|
sectionLabel(label: AppLocalizations.of(context)!.blockedServices),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24),
|
||||||
child: Material(
|
child: Material(
|
||||||
|
@ -577,14 +592,16 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
sectionLabel(AppLocalizations.of(context)!.upstreamServers),
|
sectionLabel(label: AppLocalizations.of(context)!.upstreamServers),
|
||||||
if (editMode == true) Padding(
|
if (editMode == true) Padding(
|
||||||
padding: const EdgeInsets.only(right: 20),
|
padding: const EdgeInsets.only(right: 20),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () => setState(() => upstreamServers.add({
|
onPressed: () => setState(() => upstreamServers.add(
|
||||||
'id': uuid.v4(),
|
Map<String, Object>.from({
|
||||||
'controller': TextEditingController()
|
'id': uuid.v4(),
|
||||||
})),
|
'controller': TextEditingController()
|
||||||
|
})
|
||||||
|
)),
|
||||||
icon: const Icon(Icons.add)
|
icon: const Icon(Icons.add)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
@ -630,7 +647,7 @@ class _ClientScreenState extends State<ClientScreen> {
|
||||||
),
|
),
|
||||||
)).toList(),
|
)).toList(),
|
||||||
if (upstreamServers.isEmpty) Container(
|
if (upstreamServers.isEmpty) Container(
|
||||||
padding: const EdgeInsets.only(top: 10),
|
padding: const EdgeInsets.only(top: 12),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue