Added support for general protection legacy mode

This commit is contained in:
Juan Gilsanz Polo 2023-04-13 18:07:37 +02:00
parent 20b2f89602
commit 9e400f7efa
5 changed files with 209 additions and 54 deletions

View file

@ -366,6 +366,25 @@ class ServersProvider with ChangeNotifier {
return result['log'];
}
case 'general_legacy':
_protectionsManagementProcess.add('general');
notifyListeners();
final result = await updateGeneralProtectionLegacy(server, newStatus);
_protectionsManagementProcess = _protectionsManagementProcess.where((e) => e != 'general').toList();
if (result['result'] == 'success') {
_serverStatus.data!.generalEnabled = newStatus;
notifyListeners();
return null;
}
else {
notifyListeners();
return result['log'];
}
case 'filtering':
_protectionsManagementProcess.add('filtering');
notifyListeners();