chore: Merge backups-testing to master
continuous-integration/drone/push Build is passing Details

- Remove unused breaking isHidden field
- Add commentary for Hetzner Volume replicating Hetzner documentation
- Update router.gr (when i ran build_runner this file changed for some reason)

Co-authored-by: NaiJi <naijiworld@protonmail.com>
Reviewed-on: #232
Reviewed-by: Inex Code <inex.code@selfprivacy.org>
pull/233/head^2
NaiJi ✨ 2023-07-10 12:00:46 +03:00
parent 071f5c2c5d
commit c0d8d37989
4 changed files with 346 additions and 333 deletions

View File

@ -137,6 +137,12 @@ class HetznerLocation {
_$HetznerLocationFromJson(json);
}
/// A Volume is a highly-available, scalable, and SSD-based block storage for Servers.
///
/// Pricing for Volumes depends on the Volume size and Location, not the actual used storage.
///
/// Please see Hetzner Docs for more details about Volumes.
/// https://docs.hetzner.cloud/#volumes
@JsonSerializable()
class HetznerVolume {
HetznerVolume(
@ -146,11 +152,20 @@ class HetznerVolume {
this.name,
this.linuxDevice,
);
/// ID of the Resource
final int id;
/// Size in GB of the Volume
final int size;
/// ID of the Server the Volume is attached to, null if it is not attached at all
final int? serverId;
/// Name of the Resource. Is unique per Project.
final String name;
/// Device path on the file system for the Volume
@JsonKey(name: 'linux_device')
final String? linuxDevice;

View File

@ -50,7 +50,6 @@ class ServerJob {
final String? result;
final String? statusText;
final DateTime? finishedAt;
bool isHidden = false;
}
enum JobStatusEnum {

View File

@ -21,7 +21,7 @@ ServerJob _$ServerJobFromJson(Map<String, dynamic> json) => ServerJob(
finishedAt: json['finishedAt'] == null
? null
: DateTime.parse(json['finishedAt'] as String),
)..isHidden = json['isHidden'] as bool;
);
Map<String, dynamic> _$ServerJobToJson(ServerJob instance) => <String, dynamic>{
'name': instance.name,
@ -36,7 +36,6 @@ Map<String, dynamic> _$ServerJobToJson(ServerJob instance) => <String, dynamic>{
'result': instance.result,
'statusText': instance.statusText,
'finishedAt': instance.finishedAt?.toIso8601String(),
'isHidden': instance.isHidden,
};
const _$JobStatusEnumEnumMap = {

View File

@ -15,103 +15,10 @@ abstract class _$RootRouter extends RootStackRouter {
@override
final Map<String, PageFactory> pagesMap = {
DevicesRoute.name: (routeData) {
RootRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const DevicesScreen(),
);
},
DnsDetailsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const DnsDetailsPage(),
);
},
AppSettingsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const AppSettingsPage(),
);
},
DeveloperSettingsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const DeveloperSettingsPage(),
);
},
AboutApplicationRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const AboutApplicationPage(),
);
},
MoreRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const MorePage(),
);
},
ConsoleRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const ConsolePage(),
);
},
OnboardingRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const OnboardingPage(),
);
},
ProvidersRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const ProvidersPage(),
);
},
RecoveryKeyRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const RecoveryKeyPage(),
);
},
ServerDetailsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const ServerDetailsScreen(),
);
},
ServicesMigrationRoute.name: (routeData) {
final args = routeData.argsAs<ServicesMigrationRouteArgs>();
return AutoRoutePage<dynamic>(
routeData: routeData,
child: ServicesMigrationPage(
services: args.services,
diskStatus: args.diskStatus,
isMigration: args.isMigration,
key: args.key,
),
);
},
ServerStorageRoute.name: (routeData) {
final args = routeData.argsAs<ServerStorageRouteArgs>();
return AutoRoutePage<dynamic>(
routeData: routeData,
child: ServerStoragePage(
diskStatus: args.diskStatus,
key: args.key,
),
);
},
ExtendingVolumeRoute.name: (routeData) {
final args = routeData.argsAs<ExtendingVolumeRouteArgs>();
return AutoRoutePage<dynamic>(
routeData: routeData,
child: ExtendingVolumePage(
diskVolumeToResize: args.diskVolumeToResize,
diskStatus: args.diskStatus,
key: args.key,
),
child: WrappedRoute(child: const RootPage()),
);
},
ServiceRoute.name: (routeData) {
@ -130,16 +37,10 @@ abstract class _$RootRouter extends RootStackRouter {
child: const ServicesPage(),
);
},
InitializingRoute.name: (routeData) {
ServerDetailsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const InitializingPage(),
);
},
RecoveryRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const RecoveryRouting(),
child: const ServerDetailsScreen(),
);
},
UsersRoute.name: (routeData) {
@ -164,16 +65,103 @@ abstract class _$RootRouter extends RootStackRouter {
),
);
},
RootRoute.name: (routeData) {
AppSettingsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: WrappedRoute(child: const RootPage()),
child: const AppSettingsPage(),
);
},
BackupDetailsRoute.name: (routeData) {
DeveloperSettingsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const BackupDetailsPage(),
child: const DeveloperSettingsPage(),
);
},
MoreRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const MorePage(),
);
},
AboutApplicationRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const AboutApplicationPage(),
);
},
ConsoleRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const ConsolePage(),
);
},
ProvidersRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const ProvidersPage(),
);
},
RecoveryKeyRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const RecoveryKeyPage(),
);
},
DnsDetailsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const DnsDetailsPage(),
);
},
RecoveryRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const RecoveryRouting(),
);
},
InitializingRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const InitializingPage(),
);
},
ServerStorageRoute.name: (routeData) {
final args = routeData.argsAs<ServerStorageRouteArgs>();
return AutoRoutePage<dynamic>(
routeData: routeData,
child: ServerStoragePage(
diskStatus: args.diskStatus,
key: args.key,
),
);
},
ExtendingVolumeRoute.name: (routeData) {
final args = routeData.argsAs<ExtendingVolumeRouteArgs>();
return AutoRoutePage<dynamic>(
routeData: routeData,
child: ExtendingVolumePage(
diskVolumeToResize: args.diskVolumeToResize,
diskStatus: args.diskStatus,
key: args.key,
),
);
},
ServicesMigrationRoute.name: (routeData) {
final args = routeData.argsAs<ServicesMigrationRouteArgs>();
return AutoRoutePage<dynamic>(
routeData: routeData,
child: ServicesMigrationPage(
services: args.services,
diskStatus: args.diskStatus,
isMigration: args.isMigration,
key: args.key,
),
);
},
DevicesRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const DevicesScreen(),
);
},
BackupsListRoute.name: (routeData) {
@ -186,37 +174,167 @@ abstract class _$RootRouter extends RootStackRouter {
),
);
},
BackupDetailsRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const BackupDetailsPage(),
);
},
OnboardingRoute.name: (routeData) {
return AutoRoutePage<dynamic>(
routeData: routeData,
child: const OnboardingPage(),
);
},
};
}
/// generated route for
/// [DevicesScreen]
class DevicesRoute extends PageRouteInfo<void> {
const DevicesRoute({List<PageRouteInfo>? children})
/// [RootPage]
class RootRoute extends PageRouteInfo<void> {
const RootRoute({List<PageRouteInfo>? children})
: super(
DevicesRoute.name,
RootRoute.name,
initialChildren: children,
);
static const String name = 'DevicesRoute';
static const String name = 'RootRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [DnsDetailsPage]
class DnsDetailsRoute extends PageRouteInfo<void> {
const DnsDetailsRoute({List<PageRouteInfo>? children})
: super(
DnsDetailsRoute.name,
/// [ServicePage]
class ServiceRoute extends PageRouteInfo<ServiceRouteArgs> {
ServiceRoute({
required String serviceId,
Key? key,
List<PageRouteInfo>? children,
}) : super(
ServiceRoute.name,
args: ServiceRouteArgs(
serviceId: serviceId,
key: key,
),
initialChildren: children,
);
static const String name = 'DnsDetailsRoute';
static const String name = 'ServiceRoute';
static const PageInfo<ServiceRouteArgs> page =
PageInfo<ServiceRouteArgs>(name);
}
class ServiceRouteArgs {
const ServiceRouteArgs({
required this.serviceId,
this.key,
});
final String serviceId;
final Key? key;
@override
String toString() {
return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}';
}
}
/// generated route for
/// [ServicesPage]
class ServicesRoute extends PageRouteInfo<void> {
const ServicesRoute({List<PageRouteInfo>? children})
: super(
ServicesRoute.name,
initialChildren: children,
);
static const String name = 'ServicesRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [ServerDetailsScreen]
class ServerDetailsRoute extends PageRouteInfo<void> {
const ServerDetailsRoute({List<PageRouteInfo>? children})
: super(
ServerDetailsRoute.name,
initialChildren: children,
);
static const String name = 'ServerDetailsRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [UsersPage]
class UsersRoute extends PageRouteInfo<void> {
const UsersRoute({List<PageRouteInfo>? children})
: super(
UsersRoute.name,
initialChildren: children,
);
static const String name = 'UsersRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [NewUserPage]
class NewUserRoute extends PageRouteInfo<void> {
const NewUserRoute({List<PageRouteInfo>? children})
: super(
NewUserRoute.name,
initialChildren: children,
);
static const String name = 'NewUserRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [UserDetailsPage]
class UserDetailsRoute extends PageRouteInfo<UserDetailsRouteArgs> {
UserDetailsRoute({
required String login,
Key? key,
List<PageRouteInfo>? children,
}) : super(
UserDetailsRoute.name,
args: UserDetailsRouteArgs(
login: login,
key: key,
),
initialChildren: children,
);
static const String name = 'UserDetailsRoute';
static const PageInfo<UserDetailsRouteArgs> page =
PageInfo<UserDetailsRouteArgs>(name);
}
class UserDetailsRouteArgs {
const UserDetailsRouteArgs({
required this.login,
this.key,
});
final String login;
final Key? key;
@override
String toString() {
return 'UserDetailsRouteArgs{login: $login, key: $key}';
}
}
/// generated route for
/// [AppSettingsPage]
class AppSettingsRoute extends PageRouteInfo<void> {
@ -245,20 +363,6 @@ class DeveloperSettingsRoute extends PageRouteInfo<void> {
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [AboutApplicationPage]
class AboutApplicationRoute extends PageRouteInfo<void> {
const AboutApplicationRoute({List<PageRouteInfo>? children})
: super(
AboutApplicationRoute.name,
initialChildren: children,
);
static const String name = 'AboutApplicationRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [MorePage]
class MoreRoute extends PageRouteInfo<void> {
@ -273,6 +377,20 @@ class MoreRoute extends PageRouteInfo<void> {
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [AboutApplicationPage]
class AboutApplicationRoute extends PageRouteInfo<void> {
const AboutApplicationRoute({List<PageRouteInfo>? children})
: super(
AboutApplicationRoute.name,
initialChildren: children,
);
static const String name = 'AboutApplicationRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [ConsolePage]
class ConsoleRoute extends PageRouteInfo<void> {
@ -287,20 +405,6 @@ class ConsoleRoute extends PageRouteInfo<void> {
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [OnboardingPage]
class OnboardingRoute extends PageRouteInfo<void> {
const OnboardingRoute({List<PageRouteInfo>? children})
: super(
OnboardingRoute.name,
initialChildren: children,
);
static const String name = 'OnboardingRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [ProvidersPage]
class ProvidersRoute extends PageRouteInfo<void> {
@ -330,65 +434,45 @@ class RecoveryKeyRoute extends PageRouteInfo<void> {
}
/// generated route for
/// [ServerDetailsScreen]
class ServerDetailsRoute extends PageRouteInfo<void> {
const ServerDetailsRoute({List<PageRouteInfo>? children})
/// [DnsDetailsPage]
class DnsDetailsRoute extends PageRouteInfo<void> {
const DnsDetailsRoute({List<PageRouteInfo>? children})
: super(
ServerDetailsRoute.name,
DnsDetailsRoute.name,
initialChildren: children,
);
static const String name = 'ServerDetailsRoute';
static const String name = 'DnsDetailsRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [ServicesMigrationPage]
class ServicesMigrationRoute extends PageRouteInfo<ServicesMigrationRouteArgs> {
ServicesMigrationRoute({
required List<Service> services,
required DiskStatus diskStatus,
required bool isMigration,
Key? key,
List<PageRouteInfo>? children,
}) : super(
ServicesMigrationRoute.name,
args: ServicesMigrationRouteArgs(
services: services,
diskStatus: diskStatus,
isMigration: isMigration,
key: key,
),
/// [RecoveryRouting]
class RecoveryRoute extends PageRouteInfo<void> {
const RecoveryRoute({List<PageRouteInfo>? children})
: super(
RecoveryRoute.name,
initialChildren: children,
);
static const String name = 'ServicesMigrationRoute';
static const String name = 'RecoveryRoute';
static const PageInfo<ServicesMigrationRouteArgs> page =
PageInfo<ServicesMigrationRouteArgs>(name);
static const PageInfo<void> page = PageInfo<void>(name);
}
class ServicesMigrationRouteArgs {
const ServicesMigrationRouteArgs({
required this.services,
required this.diskStatus,
required this.isMigration,
this.key,
});
/// generated route for
/// [InitializingPage]
class InitializingRoute extends PageRouteInfo<void> {
const InitializingRoute({List<PageRouteInfo>? children})
: super(
InitializingRoute.name,
initialChildren: children,
);
final List<Service> services;
static const String name = 'InitializingRoute';
final DiskStatus diskStatus;
final bool isMigration;
final Key? key;
@override
String toString() {
return 'ServicesMigrationRouteArgs{services: $services, diskStatus: $diskStatus, isMigration: $isMigration, key: $key}';
}
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
@ -473,175 +557,63 @@ class ExtendingVolumeRouteArgs {
}
/// generated route for
/// [ServicePage]
class ServiceRoute extends PageRouteInfo<ServiceRouteArgs> {
ServiceRoute({
required String serviceId,
/// [ServicesMigrationPage]
class ServicesMigrationRoute extends PageRouteInfo<ServicesMigrationRouteArgs> {
ServicesMigrationRoute({
required List<Service> services,
required DiskStatus diskStatus,
required bool isMigration,
Key? key,
List<PageRouteInfo>? children,
}) : super(
ServiceRoute.name,
args: ServiceRouteArgs(
serviceId: serviceId,
ServicesMigrationRoute.name,
args: ServicesMigrationRouteArgs(
services: services,
diskStatus: diskStatus,
isMigration: isMigration,
key: key,
),
initialChildren: children,
);
static const String name = 'ServiceRoute';
static const String name = 'ServicesMigrationRoute';
static const PageInfo<ServiceRouteArgs> page =
PageInfo<ServiceRouteArgs>(name);
static const PageInfo<ServicesMigrationRouteArgs> page =
PageInfo<ServicesMigrationRouteArgs>(name);
}
class ServiceRouteArgs {
const ServiceRouteArgs({
required this.serviceId,
class ServicesMigrationRouteArgs {
const ServicesMigrationRouteArgs({
required this.services,
required this.diskStatus,
required this.isMigration,
this.key,
});
final String serviceId;
final List<Service> services;
final DiskStatus diskStatus;
final bool isMigration;
final Key? key;
@override
String toString() {
return 'ServiceRouteArgs{serviceId: $serviceId, key: $key}';
return 'ServicesMigrationRouteArgs{services: $services, diskStatus: $diskStatus, isMigration: $isMigration, key: $key}';
}
}
/// generated route for
/// [ServicesPage]
class ServicesRoute extends PageRouteInfo<void> {
const ServicesRoute({List<PageRouteInfo>? children})
/// [DevicesScreen]
class DevicesRoute extends PageRouteInfo<void> {
const DevicesRoute({List<PageRouteInfo>? children})
: super(
ServicesRoute.name,
DevicesRoute.name,
initialChildren: children,
);
static const String name = 'ServicesRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [InitializingPage]
class InitializingRoute extends PageRouteInfo<void> {
const InitializingRoute({List<PageRouteInfo>? children})
: super(
InitializingRoute.name,
initialChildren: children,
);
static const String name = 'InitializingRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [RecoveryRouting]
class RecoveryRoute extends PageRouteInfo<void> {
const RecoveryRoute({List<PageRouteInfo>? children})
: super(
RecoveryRoute.name,
initialChildren: children,
);
static const String name = 'RecoveryRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [UsersPage]
class UsersRoute extends PageRouteInfo<void> {
const UsersRoute({List<PageRouteInfo>? children})
: super(
UsersRoute.name,
initialChildren: children,
);
static const String name = 'UsersRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [NewUserPage]
class NewUserRoute extends PageRouteInfo<void> {
const NewUserRoute({List<PageRouteInfo>? children})
: super(
NewUserRoute.name,
initialChildren: children,
);
static const String name = 'NewUserRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [UserDetailsPage]
class UserDetailsRoute extends PageRouteInfo<UserDetailsRouteArgs> {
UserDetailsRoute({
required String login,
Key? key,
List<PageRouteInfo>? children,
}) : super(
UserDetailsRoute.name,
args: UserDetailsRouteArgs(
login: login,
key: key,
),
initialChildren: children,
);
static const String name = 'UserDetailsRoute';
static const PageInfo<UserDetailsRouteArgs> page =
PageInfo<UserDetailsRouteArgs>(name);
}
class UserDetailsRouteArgs {
const UserDetailsRouteArgs({
required this.login,
this.key,
});
final String login;
final Key? key;
@override
String toString() {
return 'UserDetailsRouteArgs{login: $login, key: $key}';
}
}
/// generated route for
/// [RootPage]
class RootRoute extends PageRouteInfo<void> {
const RootRoute({List<PageRouteInfo>? children})
: super(
RootRoute.name,
initialChildren: children,
);
static const String name = 'RootRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [BackupDetailsPage]
class BackupDetailsRoute extends PageRouteInfo<void> {
const BackupDetailsRoute({List<PageRouteInfo>? children})
: super(
BackupDetailsRoute.name,
initialChildren: children,
);
static const String name = 'BackupDetailsRoute';
static const String name = 'DevicesRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
@ -683,3 +655,31 @@ class BackupsListRouteArgs {
return 'BackupsListRouteArgs{service: $service, key: $key}';
}
}
/// generated route for
/// [BackupDetailsPage]
class BackupDetailsRoute extends PageRouteInfo<void> {
const BackupDetailsRoute({List<PageRouteInfo>? children})
: super(
BackupDetailsRoute.name,
initialChildren: children,
);
static const String name = 'BackupDetailsRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}
/// generated route for
/// [OnboardingPage]
class OnboardingRoute extends PageRouteInfo<void> {
const OnboardingRoute({List<PageRouteInfo>? children})
: super(
OnboardingRoute.name,
initialChildren: children,
);
static const String name = 'OnboardingRoute';
static const PageInfo<void> page = PageInfo<void>(name);
}