mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-16 23:12:50 +00:00
Fixed client being added to two lists
This commit is contained in:
parent
4bb24b98b5
commit
6401dc5367
5 changed files with 29 additions and 3 deletions
|
@ -93,5 +93,7 @@
|
|||
"ipAddress": "IP address",
|
||||
"ipNotValid": "IP address not valid",
|
||||
"clientAddedSuccessfully": "Client added to the list successfully",
|
||||
"addingClient": "Adding client..."
|
||||
"addingClient": "Adding client...",
|
||||
"clientNotAdded": "Client could not be added to the list",
|
||||
"clientAnotherList": "This client is yet in another list"
|
||||
}
|
|
@ -93,5 +93,7 @@
|
|||
"ipAddress": "Dirección IP",
|
||||
"ipNotValid": "Dirección IP no válida",
|
||||
"clientAddedSuccessfully": "Cliente añadido a la lista satisfactoriamente",
|
||||
"addingClient": "Añadiendo cliente..."
|
||||
"addingClient": "Añadiendo cliente...",
|
||||
"clientNotAdded": "El cliente no se pudo añadir a la lista",
|
||||
"clientAnotherList": "El cliente ya está en otra lista"
|
||||
}
|
|
@ -59,6 +59,14 @@ class BlockedAllowedList extends StatelessWidget {
|
|||
)
|
||||
);
|
||||
}
|
||||
else if (result['result'] == 'error' && result['message'] == 'client_another_list') {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.clientAnotherList),
|
||||
backgroundColor: Colors.red,
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
|
|
|
@ -62,10 +62,18 @@ class ClientsFab extends StatelessWidget {
|
|||
)
|
||||
);
|
||||
}
|
||||
else if (result['result'] == 'error' && result['message'] == 'client_another_list') {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.clientAnotherList),
|
||||
backgroundColor: Colors.red,
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.clientNotRemoved),
|
||||
content: Text(AppLocalizations.of(context)!.clientNotAdded),
|
||||
backgroundColor: Colors.red,
|
||||
)
|
||||
);
|
||||
|
|
|
@ -285,6 +285,12 @@ Future requestAllowedBlockedClientsHosts(Server server, Map<String, List<String>
|
|||
if (result.statusCode == 200) {
|
||||
return {'result': 'success'};
|
||||
}
|
||||
else if (result.statusCode == 400) {
|
||||
return {
|
||||
'result': 'error',
|
||||
'message': 'client_another_list'
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {'result': 'error'};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue