Bug fixes

This commit is contained in:
Juan Gilsanz Polo 2023-10-08 14:22:03 +02:00
parent bb5cdc13d1
commit 151cbb996e
3 changed files with 153 additions and 101 deletions

View file

@ -13,7 +13,7 @@ class DnsInfo {
int? cacheTtlMin;
int? cacheTtlMax;
bool? cacheOptimistic;
bool resolveClients;
bool? resolveClients;
bool usePrivatePtrResolvers;
List<String> localPtrUpstreams;
String blockingIpv4;

View file

@ -79,7 +79,7 @@ class _PrivateReverseDnsServersScreenState extends State<PrivateReverseDnsServer
editReverseResolvers = true;
}
usePrivateReverseDnsResolvers = dnsProvider.dnsInfo!.usePrivatePtrResolvers;
enableReverseResolve = dnsProvider.dnsInfo!.resolveClients;
enableReverseResolve = dnsProvider.dnsInfo!.resolveClients ?? false;
validValues = true;
super.initState();
}

View file

@ -616,6 +616,7 @@ class ApiClient {
}
Future getClients() async {
try {
final result = await Future.wait([
apiRequest(server: server, method: 'get', urlPath: '/clients', type: 'get_clients'),
apiRequest(server: server, method: 'get', urlPath: '/access/list', type: 'get_clients'),
@ -655,6 +656,18 @@ class ApiClient {
)
};
}
} catch (e) {
Sentry.captureException(e);
return {
'result': 'error',
'log': AppLog(
type: 'get_clients',
dateTime: DateTime.now(),
message: 'no_response',
resBody: e.toString()
)
};
}
}
Future requestAllowedBlockedClientsHosts(Map<String, List<String>?> body) async {
@ -701,6 +714,7 @@ class ApiClient {
String? responseStatus,
String? search
}) async {
try {
final result = await apiRequest(
server: server,
method: 'get',
@ -731,9 +745,22 @@ class ApiClient {
else {
return result;
}
} catch (e) {
Sentry.captureException(e);
return {
'result': 'error',
'log': AppLog(
type: 'get_logs',
dateTime: DateTime.now(),
message: 'error_code_not_expected',
resBody: e.toString()
)
};
}
}
Future getFilteringRules() async {
try {
final result = await apiRequest(
server: server,
method: 'get',
@ -764,6 +791,18 @@ class ApiClient {
else {
return result;
}
} catch (e) {
Sentry.captureException(e);
return {
'result': 'error',
'log': AppLog(
type: 'get_filtering_rules',
dateTime: DateTime.now(),
message: 'error_code_not_expected',
resBody: e.toString()
)
};
}
}
Future postFilteringRules({
@ -899,6 +938,7 @@ class ApiClient {
}
Future getFiltering() async {
try {
final result = await Future.wait([
apiRequest(
urlPath: '/filtering/status',
@ -951,6 +991,18 @@ class ApiClient {
)
};
}
} catch (e) {
Sentry.captureException(e);
return {
'result': 'error',
'log': AppLog(
type: 'get_filtering_status',
dateTime: DateTime.now(),
message: 'no_response',
resBody: e.toString(),
)
};
}
}
Future setCustomRules({