mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-11 18:39:45 +00:00
Implement recovery cloudflare page
This commit is contained in:
parent
fa6f74e884
commit
ac93a384e9
|
@ -312,7 +312,11 @@
|
|||
"choose_server": "Choose your server",
|
||||
"choose_server_description": "We couldn't figure out which server your are trying to connect to.",
|
||||
"no_servers": "There is no available servers on your account.",
|
||||
"domain_not_available_on_token": "Selected domain is not available on this token."
|
||||
"domain_not_available_on_token": "Selected domain is not available on this token.",
|
||||
"confirm_cloudflare": "Connect to CloudFlare",
|
||||
"confirm_cloudflare_description": "Enter a Cloudflare token with access to {}:",
|
||||
"confirm_backblze": "Connect to Backblaze",
|
||||
"confirm_backblaze_description": "Enter a Backblaze token with access to backup storage:"
|
||||
|
||||
},
|
||||
"modals": {
|
||||
|
|
|
@ -314,8 +314,11 @@
|
|||
"choose_server": "Выберите сервер",
|
||||
"choose_server_description": "Не удалось определить, с каким сервером вы устанавливаете связь.",
|
||||
"no_servers": "На вашем аккаунте нет доступных серверов.",
|
||||
"domain_not_available_on_token": "Введённый токен не имеет доступа к нужному домену."
|
||||
|
||||
"domain_not_available_on_token": "Введённый токен не имеет доступа к нужному домену.",
|
||||
"confirm_cloudflare": "Подключение к Cloudflare",
|
||||
"confirm_cloudflare_description": "Введите токен Cloudflare, который имеет права на {}:",
|
||||
"confirm_backblze": "Подключение к Backblaze",
|
||||
"confirm_backblaze_description": "Введите токен Backblaze, который имеет права на хранилище резервных копий:"
|
||||
},
|
||||
"modals": {
|
||||
"_comment": "messages in modals",
|
||||
|
|
|
@ -17,10 +17,7 @@ import 'package:selfprivacy/ui/components/brand_text/brand_text.dart';
|
|||
import 'package:selfprivacy/ui/components/brand_timer/brand_timer.dart';
|
||||
import 'package:selfprivacy/ui/components/progress_bar/progress_bar.dart';
|
||||
import 'package:selfprivacy/ui/pages/rootRoute.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_server.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_hentzner_connected.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_routing.dart';
|
||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_method_select.dart';
|
||||
import 'package:selfprivacy/utils/route_transitions/basic.dart';
|
||||
|
||||
class InitializingPage extends StatelessWidget {
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
import 'package:cubit_form/cubit_form.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:selfprivacy/config/brand_theme.dart';
|
||||
import 'package:selfprivacy/logic/cubit/forms/setup/initializing/cloudflare_form_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_bottom_sheet/brand_bottom_sheet.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_button/brand_button.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_hero_screen/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/components/brand_md/brand_md.dart';
|
||||
|
||||
class RecoveryConfirmCloudflare extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var appConfig = context.watch<ServerInstallationCubit>();
|
||||
|
||||
return BlocProvider(
|
||||
create: (context) => CloudFlareFormCubit(appConfig),
|
||||
child: Builder(builder: (context) {
|
||||
var formCubitState = context.watch<CloudFlareFormCubit>().state;
|
||||
|
||||
return BrandHeroScreen(
|
||||
heroTitle: "recovering.confirm_cloudflare".tr(),
|
||||
heroSubtitle: "recovering.confirm_cloudflare_description".tr(args: [
|
||||
appConfig.state.serverDomain?.domainName ?? "your domain"
|
||||
]),
|
||||
hasBackButton: true,
|
||||
hasFlashButton: false,
|
||||
children: [
|
||||
CubitFormTextField(
|
||||
formFieldCubit: context.read<CloudFlareFormCubit>().apiKey,
|
||||
textAlign: TextAlign.center,
|
||||
scrollPadding: EdgeInsets.only(bottom: 70),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'initializing.5'.tr(),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
BrandButton.rised(
|
||||
onPressed: formCubitState.isSubmitting
|
||||
? null
|
||||
: () => context.read<CloudFlareFormCubit>().trySubmit(),
|
||||
text: 'basis.connect'.tr(),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
BrandButton.text(
|
||||
onPressed: () => showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
builder: (BuildContext context) {
|
||||
return BrandBottomSheet(
|
||||
isExpended: true,
|
||||
child: Padding(
|
||||
padding: paddingH15V0,
|
||||
child: BrandMarkdown(
|
||||
fileName: 'how_cloudflare',
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
title: 'initializing.how'.tr(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue