fdroid
Kherel 2021-03-23 20:21:42 +01:00
parent 696e12e846
commit 481a6e3d47
12 changed files with 31 additions and 19 deletions

View File

@ -167,5 +167,10 @@
"18": "How to obtain Hetzner API Token", "18": "How to obtain Hetzner API Token",
"19": "1 Go via this link ", "19": "1 Go via this link ",
"20": "\n" "20": "\n"
},
"modals": {
"_comment": "messages in modals",
"1": "Сервер с таким именем уже существует",
"2": "Уничтожить сервер и создать новый?"
} }
} }

View File

@ -167,5 +167,10 @@
"18": "Как получить Hetzner API Token'", "18": "Как получить Hetzner API Token'",
"19": "1 Переходим по ссылке ", "19": "1 Переходим по ссылке ",
"20": "\n2 Заходим в созданный нами проект. Если такового - нет, значит создаём.\n3 Наводим мышкой на боковую панель. Она должна раскрыться, показав нам пункты меню. Нас интересует последний — Security (с иконкой ключика).\n4 Далее, в верхней части интерфейса видим примерно такой список: SSH Keys, API Tokens, Certificates, Members. Нам нужен API Tokens. Переходим по нему.\n5 В правой части интерфейса, нас будет ожидать кнопка Generate API token. Если же вы используете мобильную версию сайта, в нижнем правом углу вы увидите красный плюсик. Нажимаем на эту кнопку.\n6 В поле Description, даём нашему токену название (это может быть любое название, которые вам нравиться. Сути оно не меняет." "20": "\n2 Заходим в созданный нами проект. Если такового - нет, значит создаём.\n3 Наводим мышкой на боковую панель. Она должна раскрыться, показав нам пункты меню. Нас интересует последний — Security (с иконкой ключика).\n4 Далее, в верхней части интерфейса видим примерно такой список: SSH Keys, API Tokens, Certificates, Members. Нам нужен API Tokens. Переходим по нему.\n5 В правой части интерфейса, нас будет ожидать кнопка Generate API token. Если же вы используете мобильную версию сайта, в нижнем правом углу вы увидите красный плюсик. Нажимаем на эту кнопку.\n6 В поле Description, даём нашему токену название (это может быть любое название, которые вам нравиться. Сути оно не меняет."
},
"modals": {
"_comment": "messages in modals",
"1": "Сервер с таким именем уже существует",
"2": "Уничтожить сервер и создать новый?"
} }
} }

View File

@ -161,7 +161,7 @@ class CloudflareApi extends ApiMap {
]; ];
} }
Future<List<String>?> domainList() async { Future<List<String>> domainList() async {
var url = '$rootAddress/zones?per_page=50'; var url = '$rootAddress/zones?per_page=50';
var response = await loggedClient.get( var response = await loggedClient.get(
url, url,
@ -169,7 +169,7 @@ class CloudflareApi extends ApiMap {
); );
return response.data['result'] return response.data['result']
.map<String>((el) => el['name'] as String?) .map<String>((el) => el['name'] as String)
.toList(); .toList();
} }
} }

View File

@ -15,6 +15,7 @@ import 'package:basic_utils/basic_utils.dart';
import 'package:selfprivacy/ui/components/action_button/action_button.dart'; import 'package:selfprivacy/ui/components/action_button/action_button.dart';
import 'package:selfprivacy/ui/components/brand_alert/brand_alert.dart'; import 'package:selfprivacy/ui/components/brand_alert/brand_alert.dart';
import 'app_config_cubit.dart'; import 'app_config_cubit.dart';
import 'package:easy_localization/easy_localization.dart';
class AppConfigRepository { class AppConfigRepository {
Box box = Hive.box(BNames.appConfig); Box box = Hive.box(BNames.appConfig);
@ -121,7 +122,8 @@ class AppConfigRepository {
String? domainName, String? domainName,
String? cloudFlareKey, { String? cloudFlareKey, {
void Function()? onCancel, void Function()? onCancel,
required Future<void> Function(HetznerServerDetails serverDetails) onSuccess, required Future<void> Function(HetznerServerDetails serverDetails)
onSuccess,
}) async { }) async {
var hetznerApi = HetznerApi(hetznerKey); var hetznerApi = HetznerApi(hetznerKey);
@ -139,8 +141,8 @@ class AppConfigRepository {
var nav = getIt.get<NavigationService>(); var nav = getIt.get<NavigationService>();
nav.showPopUpDialog( nav.showPopUpDialog(
BrandAlert( BrandAlert(
title: 'Сервер с таким именем уже существует', title: 'modals.1'.tr(),
contentText: 'Уничтожить сервер и создать новый?', contentText: 'modals.2'.tr(),
acitons: [ acitons: [
ActionButton( ActionButton(
text: 'Удалить', text: 'Удалить',

View File

@ -29,7 +29,7 @@ class BackblazeFormCubit extends FormCubit {
], ],
); );
super.setFields([keyId, applicationKey]); super.addFields([keyId, applicationKey]);
} }
@override @override

View File

@ -20,7 +20,7 @@ class CloudFlareFormCubit extends FormCubit {
], ],
); );
super.setFields([apiKey]); super.addFields([apiKey]);
} }
@override @override

View File

@ -17,7 +17,7 @@ class DomainSetupCubit extends Cubit<DomainSetupState> {
Future<void> load() async { Future<void> load() async {
emit(Loading(LoadingTypes.loadingDomain)); emit(Loading(LoadingTypes.loadingDomain));
var list = await (api.domainList() as Future<List<String>>); var list = await api.domainList();
if (list.isEmpty) { if (list.isEmpty) {
emit(Empty()); emit(Empty());
} else if (list.length == 1) { } else if (list.length == 1) {

View File

@ -20,7 +20,7 @@ class HetznerFormCubit extends FormCubit {
], ],
); );
super.setFields([apiKey]); super.addFields([apiKey]);
} }
@override @override

View File

@ -32,7 +32,7 @@ class RootUserFormCubit extends FormCubit {
isVisible = FieldCubit(initalValue: false); isVisible = FieldCubit(initalValue: false);
super.setFields([userName, password, isVisible]); super.addFields([userName, password, isVisible]);
} }
@override @override

View File

@ -33,7 +33,7 @@ class UserFormCubit extends FormCubit {
], ],
); );
super.setFields([login, password]); super.addFields([login, password]);
} }
@override @override

View File

@ -189,7 +189,7 @@ packages:
name: cubit_form name: cubit_form
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.0-nullsafety.0" version: "1.0.2-nullsafety.0"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -210,7 +210,7 @@ packages:
name: dio name: dio
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0-prev1" version: "4.0.0-prev3"
easy_localization: easy_localization:
dependency: "direct main" dependency: "direct main"
description: description:
@ -304,7 +304,7 @@ packages:
name: flutter_markdown name: flutter_markdown
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.0" version: "0.6.1"
flutter_secure_storage: flutter_secure_storage:
dependency: "direct main" dependency: "direct main"
description: description:
@ -363,7 +363,7 @@ packages:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.13.0" version: "0.13.1"
http_multi_server: http_multi_server:
dependency: transitive dependency: transitive
description: description:
@ -384,7 +384,7 @@ packages:
name: image name: image
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.0.2"
intl: intl:
dependency: transitive dependency: transitive
description: description:
@ -412,7 +412,7 @@ packages:
name: json_annotation name: json_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.0" version: "4.0.1"
json_serializable: json_serializable:
dependency: "direct dev" dependency: "direct dev"
description: description:
@ -580,7 +580,7 @@ packages:
name: process name: process
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.1.0" version: "4.1.1"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:

View File

@ -17,7 +17,7 @@ dependencies:
easy_localization: ^3.0.0 easy_localization: ^3.0.0
either_option: ^2.0.1-dev.1 either_option: ^2.0.1-dev.1
equatable: ^2.0.0 equatable: ^2.0.0
flutter_bloc: ^7.0.0-nullsafety.5 flutter_bloc: ^7.0.0
flutter_markdown: ^0.6.0 flutter_markdown: ^0.6.0
flutter_secure_storage: ^4.1.0 flutter_secure_storage: ^4.1.0
get_it: ^6.0.0 get_it: ^6.0.0