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