mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-27 11:16:45 +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(
|
volume = ServerVolume(
|
||||||
id: dbId,
|
id: dbId,
|
||||||
name: dbName,
|
name: dbName,
|
||||||
sizeGb: dbSize,
|
sizeByte: dbSize,
|
||||||
serverId: dbServer,
|
serverId: dbServer,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -113,7 +113,7 @@ class HetznerApi extends ApiMap {
|
||||||
final volume = ServerVolume(
|
final volume = ServerVolume(
|
||||||
id: dbId,
|
id: dbId,
|
||||||
name: dbName,
|
name: dbName,
|
||||||
sizeGb: dbSize,
|
sizeByte: dbSize,
|
||||||
serverId: dbServer,
|
serverId: dbServer,
|
||||||
);
|
);
|
||||||
volumes.add(volume);
|
volumes.add(volume);
|
||||||
|
@ -141,7 +141,7 @@ class HetznerApi extends ApiMap {
|
||||||
volume = ServerVolume(
|
volume = ServerVolume(
|
||||||
id: dbId,
|
id: dbId,
|
||||||
name: dbName,
|
name: dbName,
|
||||||
sizeGb: dbSize,
|
sizeByte: dbSize,
|
||||||
serverId: dbServer,
|
serverId: dbServer,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -491,7 +491,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
volume: ServerVolume(
|
volume: ServerVolume(
|
||||||
id: server.volumeId,
|
id: server.volumeId,
|
||||||
name: 'recovered_volume',
|
name: 'recovered_volume',
|
||||||
sizeGb: 10, // ?????
|
sizeByte: 0,
|
||||||
serverId: server.id,
|
serverId: server.id,
|
||||||
),
|
),
|
||||||
apiToken: dataState.serverDetails!.apiToken,
|
apiToken: dataState.serverDetails!.apiToken,
|
||||||
|
|
|
@ -451,7 +451,7 @@ class ServerInstallationRepository {
|
||||||
volume: ServerVolume(
|
volume: ServerVolume(
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
sizeGb: 10,
|
sizeByte: 0,
|
||||||
serverId: 0,
|
serverId: 0,
|
||||||
),
|
),
|
||||||
provider: ServerProvider.unknown,
|
provider: ServerProvider.unknown,
|
||||||
|
@ -487,7 +487,7 @@ class ServerInstallationRepository {
|
||||||
volume: ServerVolume(
|
volume: ServerVolume(
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
sizeGb: 10,
|
sizeByte: 0,
|
||||||
serverId: 0,
|
serverId: 0,
|
||||||
),
|
),
|
||||||
provider: ServerProvider.unknown,
|
provider: ServerProvider.unknown,
|
||||||
|
@ -524,7 +524,7 @@ class ServerInstallationRepository {
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
serverId: 0,
|
serverId: 0,
|
||||||
sizeGb: 10,
|
sizeByte: 0,
|
||||||
),
|
),
|
||||||
provider: ServerProvider.unknown,
|
provider: ServerProvider.unknown,
|
||||||
id: 0,
|
id: 0,
|
||||||
|
@ -550,7 +550,7 @@ class ServerInstallationRepository {
|
||||||
volume: ServerVolume(
|
volume: ServerVolume(
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
sizeGb: 10,
|
sizeByte: 0,
|
||||||
serverId: 0,
|
serverId: 0,
|
||||||
),
|
),
|
||||||
provider: ServerProvider.unknown,
|
provider: ServerProvider.unknown,
|
||||||
|
|
|
@ -47,7 +47,7 @@ class ApiVolumesCubit
|
||||||
}
|
}
|
||||||
|
|
||||||
void resizeVolume(final ServerVolume volume, final int newSizeGb) {
|
void resizeVolume(final ServerVolume volume, final int newSizeGb) {
|
||||||
if (volume.sizeGb < newSizeGb) {
|
if (volume.sizeByte < newSizeGb) {
|
||||||
HetznerApi().resizeVolume(volume.id, newSizeGb);
|
HetznerApi().resizeVolume(volume.id, newSizeGb);
|
||||||
refresh();
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class ServerVolume {
|
||||||
ServerVolume({
|
ServerVolume({
|
||||||
required this.id,
|
required this.id,
|
||||||
required this.name,
|
required this.name,
|
||||||
required this.sizeGb,
|
required this.sizeByte,
|
||||||
required this.serverId,
|
required this.serverId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -63,8 +63,8 @@ class ServerVolume {
|
||||||
int id;
|
int id;
|
||||||
@HiveField(2)
|
@HiveField(2)
|
||||||
String name;
|
String name;
|
||||||
@HiveField(3, defaultValue: 10)
|
@HiveField(3, defaultValue: 10737418240) // 10 Gb
|
||||||
int sizeGb;
|
int sizeByte;
|
||||||
@HiveField(4, defaultValue: null)
|
@HiveField(4, defaultValue: null)
|
||||||
int? serverId;
|
int? serverId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue