Compare commits
2 Commits
93793bff0a
...
6d43cb699b
Author | SHA1 | Date |
---|---|---|
Kherel | 6d43cb699b | |
Kherel | 0f35400eaa |
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
@ -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,
|
||||
),
|
||||
);
|
||||
|
|
|
@ -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}''',
|
||||
);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -60,7 +60,9 @@ class InitializingPage extends StatelessWidget {
|
|||
'Domain',
|
||||
'User',
|
||||
'Server',
|
||||
'Check'
|
||||
'Check1',
|
||||
'Check2',
|
||||
'Check3'
|
||||
],
|
||||
activeIndex: cubit.state.progress,
|
||||
),
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
),
|
||||
),
|
||||
);
|