forked from SelfPrivacy/selfprivacy.org.app
Fix volume size calculation
parent
a698d3e7b2
commit
9526035176
|
@ -8,6 +8,7 @@ import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/dns_records/dns_records_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/dns_records/dns_records_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/jobs/jobs_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/providers/providers_cubit.dart';
|
||||||
|
import 'package:selfprivacy/logic/cubit/server_volumes/server_volume_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/services/services_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/users/users_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/provider_volumes/provider_volume_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/provider_volumes/provider_volume_cubit.dart';
|
||||||
|
@ -28,6 +29,8 @@ class BlocAndProviderConfig extends StatelessWidget {
|
||||||
final recoveryKeyCubit = RecoveryKeyCubit(serverInstallationCubit);
|
final recoveryKeyCubit = RecoveryKeyCubit(serverInstallationCubit);
|
||||||
final apiDevicesCubit = ApiDevicesCubit(serverInstallationCubit);
|
final apiDevicesCubit = ApiDevicesCubit(serverInstallationCubit);
|
||||||
final apiVolumesCubit = ApiProviderVolumeCubit(serverInstallationCubit);
|
final apiVolumesCubit = ApiProviderVolumeCubit(serverInstallationCubit);
|
||||||
|
final apiServerVolumesCubit = ApiServerVolumeCubit(serverInstallationCubit);
|
||||||
|
|
||||||
return MultiProvider(
|
return MultiProvider(
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
|
@ -40,7 +43,9 @@ class BlocAndProviderConfig extends StatelessWidget {
|
||||||
create: (final _) => serverInstallationCubit,
|
create: (final _) => serverInstallationCubit,
|
||||||
lazy: false,
|
lazy: false,
|
||||||
),
|
),
|
||||||
BlocProvider(create: (final _) => ProvidersCubit()),
|
BlocProvider(
|
||||||
|
create: (final _) => ProvidersCubit(),
|
||||||
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (final _) => usersCubit..load(),
|
create: (final _) => usersCubit..load(),
|
||||||
lazy: false,
|
lazy: false,
|
||||||
|
@ -66,8 +71,13 @@ class BlocAndProviderConfig extends StatelessWidget {
|
||||||
create: (final _) => apiVolumesCubit..load(),
|
create: (final _) => apiVolumesCubit..load(),
|
||||||
),
|
),
|
||||||
BlocProvider(
|
BlocProvider(
|
||||||
create: (final _) =>
|
create: (final _) => apiServerVolumesCubit..load(),
|
||||||
JobsCubit(usersCubit: usersCubit, servicesCubit: servicesCubit),
|
),
|
||||||
|
BlocProvider(
|
||||||
|
create: (final _) => JobsCubit(
|
||||||
|
usersCubit: usersCubit,
|
||||||
|
servicesCubit: servicesCubit,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
child: child,
|
child: child,
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
class DiskSize {
|
class DiskSize {
|
||||||
DiskSize({final this.byte = 0});
|
DiskSize({final this.byte = 0});
|
||||||
|
|
||||||
double asKb() => byte / 1000.0;
|
double asKb() => byte / 1024.0;
|
||||||
double asMb() => byte / 1000000.0;
|
double asMb() => byte / 1024.0 / 1024.0;
|
||||||
double asGb() => byte / 1000000000.0;
|
double asGb() => byte / 1024.0 / 1024.0 / 1024.0;
|
||||||
|
|
||||||
int byte;
|
int byte;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue