mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-26 18:56:38 +00:00
Change volume size from Gb to Byte
This commit is contained in:
parent
0a919907c8
commit
5fd8a68597
|
@ -80,7 +80,7 @@ class HetznerApi extends ApiMap {
|
|||
volume = ServerVolume(
|
||||
id: dbId,
|
||||
name: dbName,
|
||||
sizeGb: dbSize,
|
||||
sizeByte: dbSize,
|
||||
serverId: dbServer,
|
||||
);
|
||||
} catch (e) {
|
||||
|
@ -113,7 +113,7 @@ class HetznerApi extends ApiMap {
|
|||
final volume = ServerVolume(
|
||||
id: dbId,
|
||||
name: dbName,
|
||||
sizeGb: dbSize,
|
||||
sizeByte: dbSize,
|
||||
serverId: dbServer,
|
||||
);
|
||||
volumes.add(volume);
|
||||
|
@ -141,7 +141,7 @@ class HetznerApi extends ApiMap {
|
|||
volume = ServerVolume(
|
||||
id: dbId,
|
||||
name: dbName,
|
||||
sizeGb: dbSize,
|
||||
sizeByte: dbSize,
|
||||
serverId: dbServer,
|
||||
);
|
||||
} catch (e) {
|
||||
|
|
|
@ -491,7 +491,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
|||
volume: ServerVolume(
|
||||
id: server.volumeId,
|
||||
name: 'recovered_volume',
|
||||
sizeGb: 10, // ?????
|
||||
sizeByte: 0,
|
||||
serverId: server.id,
|
||||
),
|
||||
apiToken: dataState.serverDetails!.apiToken,
|
||||
|
|
|
@ -451,7 +451,7 @@ class ServerInstallationRepository {
|
|||
volume: ServerVolume(
|
||||
id: 0,
|
||||
name: '',
|
||||
sizeGb: 10,
|
||||
sizeByte: 0,
|
||||
serverId: 0,
|
||||
),
|
||||
provider: ServerProvider.unknown,
|
||||
|
@ -487,7 +487,7 @@ class ServerInstallationRepository {
|
|||
volume: ServerVolume(
|
||||
id: 0,
|
||||
name: '',
|
||||
sizeGb: 10,
|
||||
sizeByte: 0,
|
||||
serverId: 0,
|
||||
),
|
||||
provider: ServerProvider.unknown,
|
||||
|
@ -524,7 +524,7 @@ class ServerInstallationRepository {
|
|||
id: 0,
|
||||
name: '',
|
||||
serverId: 0,
|
||||
sizeGb: 10,
|
||||
sizeByte: 0,
|
||||
),
|
||||
provider: ServerProvider.unknown,
|
||||
id: 0,
|
||||
|
@ -550,7 +550,7 @@ class ServerInstallationRepository {
|
|||
volume: ServerVolume(
|
||||
id: 0,
|
||||
name: '',
|
||||
sizeGb: 10,
|
||||
sizeByte: 0,
|
||||
serverId: 0,
|
||||
),
|
||||
provider: ServerProvider.unknown,
|
||||
|
|
|
@ -47,7 +47,7 @@ class ApiVolumesCubit
|
|||
}
|
||||
|
||||
void resizeVolume(final ServerVolume volume, final int newSizeGb) {
|
||||
if (volume.sizeGb < newSizeGb) {
|
||||
if (volume.sizeByte < newSizeGb) {
|
||||
HetznerApi().resizeVolume(volume.id, newSizeGb);
|
||||
refresh();
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ class ServerVolume {
|
|||
ServerVolume({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.sizeGb,
|
||||
required this.sizeByte,
|
||||
required this.serverId,
|
||||
});
|
||||
|
||||
|
@ -63,8 +63,8 @@ class ServerVolume {
|
|||
int id;
|
||||
@HiveField(2)
|
||||
String name;
|
||||
@HiveField(3, defaultValue: 10)
|
||||
int sizeGb;
|
||||
@HiveField(3, defaultValue: 10737418240) // 10 Gb
|
||||
int sizeByte;
|
||||
@HiveField(4, defaultValue: null)
|
||||
int? serverId;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue