mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
fix: Server installation fixes
This commit is contained in:
parent
efed52f3ec
commit
acf2001c12
|
@ -21,7 +21,6 @@ class AddServerProviderToExistingServerFormCubit extends FormCubit {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureOr<void> onSubmit() async {
|
FutureOr<void> onSubmit() async {
|
||||||
// serverInstallationCubit.setServerProviderKey(apiKey.state.value);
|
|
||||||
setServerProviderKey(apiKey.state.value);
|
setServerProviderKey(apiKey.state.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pub_semver/pub_semver.dart';
|
import 'package:pub_semver/pub_semver.dart';
|
||||||
import 'package:selfprivacy/config/get_it_config.dart';
|
import 'package:selfprivacy/config/get_it_config.dart';
|
||||||
|
@ -264,7 +263,7 @@ class ServerInstallationRepository {
|
||||||
if (result.success && result.data != null) {
|
if (result.success && result.data != null) {
|
||||||
server.copyWith(startTime: result.data);
|
server.copyWith(startTime: result.data);
|
||||||
} else {
|
} else {
|
||||||
getIt<NavigationService>().showSnackBar('jobs.reboot_failed'.tr());
|
// getIt<NavigationService>().showSnackBar('jobs.reboot_failed'.tr());
|
||||||
}
|
}
|
||||||
|
|
||||||
return server;
|
return server;
|
||||||
|
|
|
@ -409,7 +409,9 @@ class DigitalOceanServerProvider extends ServerProvider {
|
||||||
final String location,
|
final String location,
|
||||||
) async {
|
) async {
|
||||||
final bool apiInitialized = _adapter.api().isWithToken;
|
final bool apiInitialized = _adapter.api().isWithToken;
|
||||||
if (!apiInitialized) {
|
final String token = _adapter._api.token;
|
||||||
|
|
||||||
|
if (!apiInitialized || token.isEmpty) {
|
||||||
return GenericResult(
|
return GenericResult(
|
||||||
success: true,
|
success: true,
|
||||||
data: false,
|
data: false,
|
||||||
|
@ -417,10 +419,11 @@ class DigitalOceanServerProvider extends ServerProvider {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// _adapter = ApiAdapter(
|
_adapter = ApiAdapter(
|
||||||
// isWithToken: true,
|
isWithToken: true,
|
||||||
// region: location,
|
region: location,
|
||||||
// );
|
token: token,
|
||||||
|
);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -428,7 +428,8 @@ class HetznerServerProvider extends ServerProvider {
|
||||||
final String location,
|
final String location,
|
||||||
) async {
|
) async {
|
||||||
final bool apiInitialized = _adapter.api().isWithToken;
|
final bool apiInitialized = _adapter.api().isWithToken;
|
||||||
if (!apiInitialized) {
|
final String token = _adapter._api.token;
|
||||||
|
if (!apiInitialized || token.isEmpty) {
|
||||||
return GenericResult(
|
return GenericResult(
|
||||||
success: true,
|
success: true,
|
||||||
data: false,
|
data: false,
|
||||||
|
@ -439,7 +440,9 @@ class HetznerServerProvider extends ServerProvider {
|
||||||
_adapter = ApiAdapter(
|
_adapter = ApiAdapter(
|
||||||
isWithToken: true,
|
isWithToken: true,
|
||||||
region: location,
|
region: location,
|
||||||
|
token: token,
|
||||||
);
|
);
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue