mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
feat(initializing): Implement additional server type field for server installation
This commit is contained in:
parent
8a93af2b06
commit
f5a75e6eb5
|
@ -294,6 +294,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
required final String dnsApiToken,
|
||||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final String serverType,
|
||||
}) async {
|
||||
ServerHostingDetails? details;
|
||||
|
||||
|
@ -307,6 +308,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
dataBase: newVolume,
|
||||
serverType: serverType,
|
||||
);
|
||||
|
||||
return details;
|
||||
|
@ -317,6 +319,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final ServerVolume dataBase,
|
||||
required final String serverType,
|
||||
}) async {
|
||||
final Dio client = await getClient();
|
||||
|
||||
|
@ -336,7 +339,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
|||
|
||||
final Map<String, Object> data = {
|
||||
'name': hostname,
|
||||
'server_type': 'cx11',
|
||||
'server_type': serverType,
|
||||
'start_after_create': false,
|
||||
'image': 'ubuntu-20.04',
|
||||
'volumes': dbUuid == null ? [dbId] : [dbUuid],
|
||||
|
|
|
@ -298,6 +298,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
required final String dnsApiToken,
|
||||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final String serverType,
|
||||
}) async {
|
||||
ServerHostingDetails? details;
|
||||
|
||||
|
@ -311,6 +312,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
dataBase: newVolume,
|
||||
serverType: serverType,
|
||||
);
|
||||
|
||||
return details;
|
||||
|
@ -321,6 +323,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final ServerVolume dataBase,
|
||||
required final String serverType,
|
||||
}) async {
|
||||
final Dio client = await getClient();
|
||||
|
||||
|
@ -343,7 +346,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
|||
try {
|
||||
final Map<String, Object> data = {
|
||||
'name': hostname,
|
||||
'server_type': 'cx11',
|
||||
'server_type': serverType,
|
||||
'start_after_create': false,
|
||||
'image': 'ubuntu-20.04',
|
||||
'volumes': [dbId],
|
||||
|
|
|
@ -21,6 +21,7 @@ abstract class ServerProviderApi extends ApiMap {
|
|||
required final String dnsApiToken,
|
||||
required final User rootUser,
|
||||
required final String domainName,
|
||||
required final String serverType,
|
||||
});
|
||||
Future<void> createReverseDns({
|
||||
required final ServerHostingDetails serverDetails,
|
||||
|
|
|
@ -16,7 +16,6 @@ import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/dns_provider_
|
|||
import 'package:selfprivacy/logic/api_maps/rest_maps/dns_providers/dns_provider_factory.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/rest_maps/server.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/rest_maps/server_providers/server_provider.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/rest_maps/server_providers/server_provider_api_settings.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/rest_maps/server_providers/server_provider_factory.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/backblaze_credential.dart';
|
||||
|
@ -247,6 +246,7 @@ class ServerInstallationRepository {
|
|||
dnsApiToken: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
serverType: getIt<ApiConfigModel>().serverType!,
|
||||
);
|
||||
|
||||
if (serverDetails == null) {
|
||||
|
@ -277,6 +277,7 @@ class ServerInstallationRepository {
|
|||
dnsApiToken: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
serverType: getIt<ApiConfigModel>().serverType!,
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
|
@ -314,6 +315,7 @@ class ServerInstallationRepository {
|
|||
dnsApiToken: cloudFlareKey,
|
||||
rootUser: rootUser,
|
||||
domainName: domainName,
|
||||
serverType: getIt<ApiConfigModel>().serverType!,
|
||||
);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
|
|
|
@ -154,7 +154,8 @@ class SelectTypePage extends StatelessWidget {
|
|||
Text('disk: $type.disk.gibibyte'),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'price: $type.price.value $type.price.currency'),
|
||||
'price: $type.price.value $type.price.currency',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue