mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 17:11:14 +00:00
chore: Merge recovery-error into master
Reviewed-on: https://git.selfprivacy.org/kherel/selfprivacy.org.app/pulls/152 Reviewed-by: Inex Code <inex.code@selfprivacy.org>
This commit is contained in:
commit
1e8f17f16e
|
@ -392,6 +392,7 @@
|
|||
"generation_error": "Couldn't generate a recovery key. {}"
|
||||
},
|
||||
"modals": {
|
||||
"server_validators_error": "Couldn't fetch available servers.",
|
||||
"already_exists": "Such server already exists.",
|
||||
"unexpected_error": "Unexpected error during placement from the provider side.",
|
||||
"destroy_server": "Destroy the server and create a new one?",
|
||||
|
|
|
@ -392,6 +392,7 @@
|
|||
"generation_error": "Не удалось сгенерировать ключ. {}"
|
||||
},
|
||||
"modals": {
|
||||
"server_validators_error": "Не удалось получить список серверов.",
|
||||
"already_exists": "Такой сервер уже существует.",
|
||||
"unexpected_error": "Непредвиденная ошибка со стороны провайдера.",
|
||||
"destroy_server": "Уничтожить сервер и создать новый?",
|
||||
|
|
|
@ -23,7 +23,7 @@ import 'package:selfprivacy/utils/password_generator.dart';
|
|||
class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
||||
DigitalOceanApi({
|
||||
required this.region,
|
||||
this.hasLogger = false,
|
||||
this.hasLogger = true,
|
||||
this.isWithToken = true,
|
||||
});
|
||||
@override
|
||||
|
|
|
@ -24,7 +24,7 @@ import 'package:selfprivacy/utils/password_generator.dart';
|
|||
class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||
HetznerApi({
|
||||
this.region,
|
||||
this.hasLogger = false,
|
||||
this.hasLogger = true,
|
||||
this.isWithToken = true,
|
||||
});
|
||||
@override
|
||||
|
|
|
@ -633,18 +633,27 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
state as ServerInstallationRecovery;
|
||||
final List<ServerBasicInfo> servers =
|
||||
await repository.getServersOnProviderAccount();
|
||||
final Iterable<ServerBasicInfoWithValidators> validated = servers.map(
|
||||
(final ServerBasicInfo server) =>
|
||||
ServerBasicInfoWithValidators.fromServerBasicInfo(
|
||||
serverBasicInfo: server,
|
||||
isIpValid: server.ip == dataState.serverDetails?.ip4,
|
||||
isReverseDnsValid:
|
||||
server.reverseDns == dataState.serverDomain?.domainName ||
|
||||
server.reverseDns ==
|
||||
dataState.serverDomain?.domainName.split('.')[0],
|
||||
),
|
||||
);
|
||||
return validated.toList();
|
||||
List<ServerBasicInfoWithValidators> validatedList = [];
|
||||
try {
|
||||
final Iterable<ServerBasicInfoWithValidators> validated = servers.map(
|
||||
(final ServerBasicInfo server) =>
|
||||
ServerBasicInfoWithValidators.fromServerBasicInfo(
|
||||
serverBasicInfo: server,
|
||||
isIpValid: server.ip == dataState.serverDetails?.ip4,
|
||||
isReverseDnsValid:
|
||||
server.reverseDns == dataState.serverDomain?.domainName ||
|
||||
server.reverseDns ==
|
||||
dataState.serverDomain?.domainName.split('.')[0],
|
||||
),
|
||||
);
|
||||
validatedList = validated.toList();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
getIt<NavigationService>()
|
||||
.showSnackBar('modals.server_validators_error'.tr());
|
||||
}
|
||||
|
||||
return validatedList;
|
||||
}
|
||||
|
||||
Future<void> setServerId(final ServerBasicInfo server) async {
|
||||
|
|
Loading…
Reference in a new issue