mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-11 18:39:45 +00:00
Bug fix error processing for installation cubits
This commit is contained in:
parent
3024016fe2
commit
313cfc7187
|
@ -259,6 +259,9 @@
|
|||
"1": "Connect a server",
|
||||
"2": "A place where your data and SelfPrivacy services will reside:",
|
||||
"how": "How to obtain API token",
|
||||
"hetzner_bad_key_error": "Hetzner API key is invalid",
|
||||
"cloudflare_bad_key_error": "Cloudflare API key is invalid",
|
||||
"backblaze_bad_key_error": "Backblaze storage information is invalid",
|
||||
"3": "Connect CloudFlare",
|
||||
"4": "To manage your domain's DNS",
|
||||
"5": "CloudFlare API Token",
|
||||
|
|
|
@ -260,6 +260,9 @@
|
|||
"1": "Подключите сервер",
|
||||
"2": "Здесь будут жить наши данные и SelfPrivacy-сервисы",
|
||||
"how": "Как получить API Token",
|
||||
"hetzner_bad_key_error": "Hetzner API ключ неверен",
|
||||
"cloudflare_bad_key_error": "Cloudflare API ключ неверен",
|
||||
"backblaze_bad_key_error": "Информация о Backblaze хранилище неверна",
|
||||
"3": "Подключите CloudFlare",
|
||||
"4": "Для управления DNS вашего домена",
|
||||
"5": "CloudFlare API Token",
|
||||
|
|
|
@ -55,10 +55,11 @@ class BackblazeFormCubit extends FormCubit {
|
|||
}
|
||||
|
||||
if (!isKeyValid) {
|
||||
keyId.setError('bad key');
|
||||
applicationKey.setError('bad key');
|
||||
keyId.setError('initializing.backblaze_bad_key_error'.tr());
|
||||
applicationKey.setError('initializing.backblaze_bad_key_error'.tr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,12 +42,14 @@ class CloudFlareFormCubit extends FormCubit {
|
|||
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
||||
} catch (e) {
|
||||
addError(e);
|
||||
isKeyValid = false;
|
||||
}
|
||||
|
||||
if (!isKeyValid) {
|
||||
apiKey.setError('bad key');
|
||||
apiKey.setError('initializing.cloudflare_bad_key_error'.tr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,12 +42,14 @@ class HetznerFormCubit extends FormCubit {
|
|||
isKeyValid = await apiClient.isValid(apiKey.state.value);
|
||||
} catch (e) {
|
||||
addError(e);
|
||||
isKeyValid = false;
|
||||
}
|
||||
|
||||
if (!isKeyValid) {
|
||||
apiKey.setError('bad key');
|
||||
apiKey.setError('initializing.hetzner_bad_key_error'.tr());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -242,13 +242,18 @@ class ServerInstallationRepository {
|
|||
domainName: domainName,
|
||||
);
|
||||
|
||||
final ServerHostingDetails? serverDetails =
|
||||
await hetznerApi.createServer(
|
||||
cloudFlareKey: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
dataBase: dataBase,
|
||||
);
|
||||
ServerHostingDetails? serverDetails;
|
||||
try {
|
||||
serverDetails = await hetznerApi.createServer(
|
||||
cloudFlareKey: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
dataBase: dataBase,
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
|
||||
if (serverDetails == null) {
|
||||
print('Server is not initialized!');
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue