mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-02-04 07:20:39 +00:00
Implement volume extending button
This commit is contained in:
parent
8017c5ab4c
commit
d9b82b1250
|
@ -203,6 +203,7 @@
|
|||
"extending_volume_title": "Extending volume",
|
||||
"extending_volume_description": "Resizing volume will allow you to store more data on your server without extending the server itself. Volume can only be extended: shrinking is not possible.",
|
||||
"extending_volume_price_info": "Price includes VAT and is estimated from pricing data provided by Hetzner.",
|
||||
"extending_volume_error": "Couldn't initialize volume extending.",
|
||||
"size": "Size",
|
||||
"euro": "Euro",
|
||||
"data_migration_title": "Data migration",
|
||||
|
|
|
@ -205,6 +205,7 @@
|
|||
"extending_volume_title": "Расширение хранилища",
|
||||
"extending_volume_description": "Изменение размера хранилища позволит вам держать больше данных на вашем сервере без расширения самого сервера. Объем можно только увеличить: уменьшить нельзя.",
|
||||
"extending_volume_price_info": "Цена включает НДС и рассчитана на основе данных о ценах, предоставленных Hetzner.",
|
||||
"extending_volume_error": "Не удалось начать расширение хранилища.",
|
||||
"size": "Размер",
|
||||
"euro": "Евро",
|
||||
"data_migration_title": "Миграция данных",
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:selfprivacy/config/get_it_config.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/graphql_maps/server_api/server.dart';
|
||||
import 'package:selfprivacy/logic/api_maps/rest_maps/api_factory_creator.dart';
|
||||
|
@ -77,6 +78,9 @@ class ApiProviderVolumeCubit
|
|||
);
|
||||
|
||||
if (!resized) {
|
||||
getIt<NavigationService>().showSnackBar(
|
||||
'providers.storage.extending_volume_error'.tr(),
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,14 @@ class _ExtendingVolumePageState extends State<ExtendingVolumePage> {
|
|||
const SizedBox(height: 16),
|
||||
FilledButton(
|
||||
title: 'providers.storage.extend_volume_button.title'.tr(),
|
||||
onPressed: _isError ? null : () => {},
|
||||
onPressed: _isError
|
||||
? null
|
||||
: () => {
|
||||
context.read<ApiProviderVolumeCubit>().resizeVolume(
|
||||
widget.diskVolumeToResize,
|
||||
_currentSliderGbValue.round(),
|
||||
),
|
||||
},
|
||||
disabled: _isError,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
|
Loading…
Reference in a new issue