mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-08 00:51:20 +00:00
Merge pull request 'fix: Force size value truncation for digital ocean, change query url' (#368) from digital-ocean-volume into master
Reviewed-on: https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.app/pulls/368 Reviewed-by: Inex Code <inex.code@selfprivacy.org>
This commit is contained in:
commit
0cb2f2082a
|
@ -455,8 +455,8 @@ class DigitalOceanApi extends RestApiMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<GenericResult<bool>> resizeVolume(
|
Future<GenericResult<bool>> resizeVolume(
|
||||||
final String name,
|
final String uuid,
|
||||||
final DiskSize size,
|
final int gb,
|
||||||
) async {
|
) async {
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
|
||||||
|
@ -464,11 +464,10 @@ class DigitalOceanApi extends RestApiMap {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
resizeVolumeResponse = await client.post(
|
resizeVolumeResponse = await client.post(
|
||||||
'/volumes/actions',
|
'/volumes/$uuid/actions',
|
||||||
data: {
|
data: {
|
||||||
'type': 'resize',
|
'type': 'resize',
|
||||||
'volume_name': name,
|
'size_gigabytes': gb,
|
||||||
'size_gigabytes': size.gibibyte,
|
|
||||||
'region': region,
|
'region': region,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -698,8 +698,8 @@ class DigitalOceanServerProvider extends ServerProvider {
|
||||||
final DiskSize size,
|
final DiskSize size,
|
||||||
) async =>
|
) async =>
|
||||||
_adapter.api().resizeVolume(
|
_adapter.api().resizeVolume(
|
||||||
volume.name,
|
volume.uuid!,
|
||||||
size,
|
size.gibibyte.toInt(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -157,7 +157,9 @@ class _ExtendingVolumePageState extends State<ExtendingVolumePage> {
|
||||||
: () {
|
: () {
|
||||||
context.read<ApiProviderVolumeCubit>().resizeVolume(
|
context.read<ApiProviderVolumeCubit>().resizeVolume(
|
||||||
widget.diskVolumeToResize,
|
widget.diskVolumeToResize,
|
||||||
DiskSize.fromGibibyte(_currentSliderGbValue),
|
DiskSize.fromGibibyte(
|
||||||
|
_currentSliderGbValue.truncate().toDouble(),
|
||||||
|
),
|
||||||
context.read<ApiServerVolumeCubit>().reload,
|
context.read<ApiServerVolumeCubit>().reload,
|
||||||
);
|
);
|
||||||
context.router.popUntilRoot();
|
context.router.popUntilRoot();
|
||||||
|
|
Loading…
Reference in a new issue