Compare commits

...

2 Commits

Author SHA1 Message Date
Kherel 6d43cb699b update 2021-02-17 17:20:09 +01:00
Kherel 0f35400eaa update 2021-02-17 15:30:02 +01:00
27 changed files with 459 additions and 216 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -61,14 +61,14 @@ final linkStyle = defaultTextStyle.copyWith(color: BrandColors.blue);
final progressTextStyleLight = GoogleFonts.inter(
textStyle: TextStyle(
fontSize: 13,
fontSize: 11,
color: BrandColors.textColor1,
),
);
final progressTextStyleDark = GoogleFonts.inter(
textStyle: TextStyle(
fontSize: 13,
fontSize: 11,
color: BrandColors.white,
),
);

View File

@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:selfprivacy/logic/api_maps/api_map.dart';
import 'package:selfprivacy/logic/models/server_details.dart';
import 'package:selfprivacy/logic/models/user.dart';
import 'package:selfprivacy/utils/password_generator2.dart';
class HetznerApi extends ApiMap {
HetznerApi([String token]) {
@ -43,8 +44,9 @@ class HetznerApi extends ApiMap {
@required String cloudFlareKey,
@required User rootUser,
@required String domainName,
@required String dbPassword,
}) async {
var dbPassword = getRandomString(40);
var data = jsonDecode(
'''{"name":"selfprivacy-server","server_type":"cx11","start_after_create":false,"image":"ubuntu-20.04", "volumes":[],"networks":[],"user_data":"#cloud-config\\nruncmd:\\n- curl https://git.selfprivacy.org/ilchub/selfprivacy-nixos-infect/raw/branch/master/nixos-infect | PROVIDER=hetzner NIX_CHANNEL=nixos-20.09 DOMAIN=$domainName LUSER=${rootUser.login} PASSWORD=${rootUser.password} HASHED_PASSWORD=${rootUser.hashPassword} CF_TOKEN=$cloudFlareKey DB_PASSWORD=$dbPassword bash 2>&1 | tee /tmp/infect.log","labels":{},"automount":false}''',
);

View File

@ -46,14 +46,12 @@ class _ProgressBarState extends State<ProgressBar> {
}
i++;
}
// even.add(SizedBox(
// width: 0,
// ));
odd
..insert(
0,
SizedBox(
width: 40,
width: 20,
),
)
..add(
@ -68,7 +66,7 @@ class _ProgressBarState extends State<ProgressBar> {
BrandText.h2('Progress'),
SizedBox(height: 10),
Row(children: even),
SizedBox(height: 3),
SizedBox(height: 7),
Container(
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
@ -95,7 +93,7 @@ class _ProgressBarState extends State<ProgressBar> {
},
),
),
SizedBox(height: 3),
SizedBox(height: 5),
Row(
children: odd,
),
@ -122,8 +120,8 @@ class _ProgressBarState extends State<ProgressBar> {
checked
? WidgetSpan(
child: Padding(
padding: const EdgeInsets.only(bottom: 1, right: 2),
child: Icon(BrandIcons.check, size: 14),
padding: const EdgeInsets.only(bottom: 0, right: 2),
child: Icon(BrandIcons.check, size: 11),
))
: TextSpan(text: '${index + 1}.', style: style),
TextSpan(text: step, style: style)

View File

@ -60,7 +60,9 @@ class InitializingPage extends StatelessWidget {
'Domain',
'User',
'Server',
'Check'
'Check1',
'Check2',
'Check3'
],
activeIndex: cubit.state.progress,
),

View File

@ -61,7 +61,12 @@ class _OnboardingPageState extends State<OnboardingPage> {
Flexible(
child: Center(
child: Image.asset(
'assets/images/onboarding/onboarding1.png',
_fileName(
context: context,
path: 'assets/images/onboarding',
fileExtention: 'png',
fileName: 'onboarding1',
),
),
),
),
@ -96,13 +101,23 @@ class _OnboardingPageState extends State<OnboardingPage> {
SizedBox(height: 20),
Center(
child: Image.asset(
'assets/images/onboarding/logos_line.png',
_fileName(
context: context,
path: 'assets/images/onboarding',
fileExtention: 'png',
fileName: 'logos_line',
),
),
),
Flexible(
child: Center(
child: Image.asset(
'assets/images/onboarding/onboarding2.png',
_fileName(
context: context,
path: 'assets/images/onboarding',
fileExtention: 'png',
fileName: 'onboarding2',
),
),
),
),
@ -120,3 +135,14 @@ class _OnboardingPageState extends State<OnboardingPage> {
);
}
}
String _fileName({
@required BuildContext context,
@required String path,
@required String fileName,
@required String fileExtention,
}) {
var theme = Theme.of(context);
var isDark = theme.brightness == Brightness.dark;
return '$path/$fileName${isDark ? '-dark' : '-light'}.$fileExtention';
}

View File

@ -0,0 +1,14 @@
import 'dart:math';
const _chars =
'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890_';
Random _rnd = Random();
String getRandomString(int length) => String.fromCharCodes(
Iterable.generate(
length,
(_) => _chars.codeUnitAt(
_rnd.nextInt(_chars.length),
),
),
);