mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 17:26:35 +00:00
Implement recovery backblaze page
This commit is contained in:
parent
ac93a384e9
commit
7344858e86
|
@ -153,15 +153,14 @@ class ServerApi extends ApiMap {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<ApiResponse<List<String>>> getUsersList(
|
Future<ApiResponse<List<String>>> getUsersList({withMainUser = false}) async {
|
||||||
{withMainUser = false}
|
|
||||||
) async {
|
|
||||||
List<String> res = [];
|
List<String> res = [];
|
||||||
Response response;
|
Response response;
|
||||||
|
|
||||||
var client = await getClient();
|
var client = await getClient();
|
||||||
try {
|
try {
|
||||||
response = await client.get('/users', queryParameters: withMainUser ? {'withMainUser': 'true'} : null);
|
response = await client.get('/users',
|
||||||
|
queryParameters: withMainUser ? {'withMainUser': 'true'} : null);
|
||||||
for (var user in response.data) {
|
for (var user in response.data) {
|
||||||
res.add(user.toString());
|
res.add(user.toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,77 @@
|
||||||
|
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/backblaze_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 RecoveryConfirmBackblaze extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var appConfig = context.watch<ServerInstallationCubit>();
|
||||||
|
|
||||||
|
return BlocProvider(
|
||||||
|
create: (context) => BackblazeFormCubit(appConfig),
|
||||||
|
child: Builder(builder: (context) {
|
||||||
|
var formCubitState = context.watch<BackblazeFormCubit>().state;
|
||||||
|
|
||||||
|
return BrandHeroScreen(
|
||||||
|
heroTitle: "recovering.confirm_backblaze".tr(),
|
||||||
|
heroSubtitle: "recovering.confirm_backblaze_description".tr(),
|
||||||
|
hasBackButton: true,
|
||||||
|
hasFlashButton: false,
|
||||||
|
children: [
|
||||||
|
CubitFormTextField(
|
||||||
|
formFieldCubit: context.read<BackblazeFormCubit>().keyId,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
scrollPadding: EdgeInsets.only(bottom: 70),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: 'KeyID',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
CubitFormTextField(
|
||||||
|
formFieldCubit: context.read<BackblazeFormCubit>().applicationKey,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
scrollPadding: EdgeInsets.only(bottom: 70),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: 'Master Application Key',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
BrandButton.rised(
|
||||||
|
onPressed: formCubitState.isSubmitting
|
||||||
|
? null
|
||||||
|
: () => context.read<BackblazeFormCubit>().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_backblaze',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: 'initializing.how'.tr(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue