diff --git a/assets/translations/en.json b/assets/translations/en.json index 1885fd73..8571b1c0 100644 --- a/assets/translations/en.json +++ b/assets/translations/en.json @@ -227,6 +227,64 @@ "explicit": "Created by your explicit request", "pre_restore": "Created as a precaution before risky restore", "unknown": "Unknown" + }, + "rotation_quotas_title": "Snapshot rotation settings", + "set_rotation_quotas": "Set new rotation quotas", + "quotas_set": "New backup rotation quotas set", + "quota_titles": { + "last": "How many latest backups to keep", + "daily": "How many daily backups to keep", + "weekly": "How many weekly backups to keep", + "monthly": "How many monthly backups to keep", + "yearly": "How many yearly backups to keep" + }, + "quota_subtitles": { + "no_effect": "This rule has no effect because another rule will keep more backups", + "last": { + "zero": "Rule is disabled", + "one": "Last {} backup will be kept regardless of its age", + "two": "Last {} backups will be kept regardless of their age", + "few": "Last {} backups will be kept regardless of their age", + "many": "Last {} backups will be kept regardless of their age", + "other": "Last {} backups will be kept regardless of their age" + }, + "last_infinite": "All backups will be kept", + "daily": { + "zero": "Rule is disabled", + "one": "Last {} daily backup will be kept", + "two": "Last {} daily backups will be kept", + "few": "Last {} daily backups will be kept", + "many": "Last {} daily backups will be kept", + "other": "Last {} daily backups will be kept" + }, + "daily_infinite": "All daily backups will be kept", + "weekly": { + "zero": "Rule is disabled", + "one": "Last {} weekly backup will be kept", + "two": "Last {} weekly backups will be kept", + "few": "Last {} weekly backups will be kept", + "many": "Last {} weekly backups will be kept", + "other": "Last {} weekly backups will be kept" + }, + "weekly_infinite": "All weekly backups will be kept", + "monthly": { + "zero": "Rule is disabled", + "one": "Last {} monthly backup will be kept", + "two": "Last {} monthly backups will be kept", + "few": "Last {} monthly backups will be kept", + "many": "Last {} monthly backups will be kept", + "other": "Last {} monthly backups will be kept" + }, + "monthly_infinite": "All monthly backups will be kept", + "yearly": { + "zero": "Rule is disabled", + "one": "Last {} yearly backup will be kept", + "two": "Last {} yearly backups will be kept", + "few": "Last {} yearly backups will be kept", + "many": "Last {} yearly backups will be kept", + "other": "Last {} yearly backups will be kept" + }, + "yearly_infinite": "All yearly backups will be kept" } }, "storage": { diff --git a/flake.nix b/flake.nix index d1895b0a..a124dc2c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,7 +1,7 @@ { nixConfig.bash-prompt = "\[selfprivacy\]$ "; - inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + inputs.nixpkgs.url = "nixpkgs/nixos-unstable"; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.nixgl.url = "github:guibou/nixGL"; @@ -9,19 +9,48 @@ flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { + inherit system; config.allowUnfree = true; config.android_sdk.accept_license = true; - system = "x86_64-linux"; overlays = [ nixgl.overlay ]; }; androidComposition = pkgs.androidenv.composeAndroidPackages { - toolsVersion = "26.1.1"; - platformToolsVersion = "33.0.2"; - buildToolsVersions = [ "30.0.3" ]; - platformVersions = [ "31" "30" "29" ]; + platformToolsVersion = "34.0.4"; + buildToolsVersions = [ "34.0.0" ]; + platformVersions = [ "34" "33" "32" "31" "30" ]; }; + spAndroidStudio = pkgs.symlinkJoin { + name = "spAndroidStudio"; + paths = with pkgs; [ + android-studio + flutter.unwrapped + # dart + gnumake + check + pkg-config + glibc + android-tools + jdk + git + ]; + + nativeBuildInputs = [ pkgs.makeWrapper ]; + postBuild = '' + wrapProgram $out/bin/flutter \ + --prefix ANDROID_SDK_ROOT=${androidComposition.androidsdk}/libexec/android-sdk \ + --prefix ANDROID_HOME=${androidComposition.androidsdk}/libexec/android-sdk \ + --prefix ANDROID_JAVA_HOME=${pkgs.jdk.home} + + wrapProgram $out/bin/android-studio \ + --prefix FLUTTER_SDK=${pkgs.flutter.unwrapped} \ + --prefix ANDROID_SDKz_ROOT=${androidComposition.androidsdk}/libexec/android-sdk \ + --prefix ANDROID_HOME=${androidComposition.androidsdk}/libexec/android-sdk \ + --prefix ANDROID_JAVA_HOME=${pkgs.jdk.home} + ''; + }; + buildDeps = with pkgs; [ gtk3 glib @@ -62,23 +91,23 @@ openjdk11_headless clang ]; - + releaseDerivation = pkgs.flutter.mkFlutterApp rec { pname = "selfprivacy"; version = "0.6.0"; - + vendorHash = "sha256-7cbiAyIlaz3HqEsZN/nZxaLZjseJv5CmiIHqsoGa4ZI="; - + nativeBuildInputs = [ pkgs.nixgl.auto.nixGLDefault ]; - + src = ./.; - + desktopItem = pkgs.makeDesktopItem { name = "${pname}"; exec = "@out@/bin/${pname}"; desktopName = "SelfPrivacy"; }; - + postInstall = '' rm $out/bin/$pname @@ -86,7 +115,7 @@ patchShebangs $out/bin/$pname chmod +x $out/bin/$pname wrapProgram $out/bin/$pname --set PATH ${pkgs.lib.makeBinPath [ pkgs.xdg-user-dirs ]} - + mkdir -p $out/share/applications cp $desktopItem/share/applications/*.desktop $out/share/applications substituteInPlace $out/share/applications/*.desktop --subst-var out diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql b/lib/logic/api_maps/graphql_maps/schema/backups.graphql index 410b7343..16930940 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql @@ -7,6 +7,13 @@ query BackupConfiguration { locationId locationName provider + autobackupQuotas { + last + daily + weekly + monthly + yearly + } } } } @@ -36,6 +43,13 @@ fragment genericBackupConfigReturn on GenericBackupConfigReturn { autobackupPeriod locationName locationId + autobackupQuotas { + last + daily + weekly + monthly + yearly + } } } @@ -66,6 +80,14 @@ mutation SetAutobackupPeriod($period: Int = null) { } } +mutation setAutobackupQuotas($quotas: AutobackupQuotasInput!) { + backup { + setAutobackupQuotas(quotas: $quotas) { + ...genericBackupConfigReturn + } + } +} + mutation RemoveRepository { backup { removeRepository { diff --git a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart index 9dcd9e91..1df1e8ac 100644 --- a/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart +++ b/lib/logic/api_maps/graphql_maps/schema/backups.graphql.dart @@ -287,6 +287,56 @@ const fragmentDefinitiongenericBackupConfigReturn = FragmentDefinitionNode( directives: [], selectionSet: null, ), + FieldNode( + name: NameNode(value: 'autobackupQuotas'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'last'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'daily'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'weekly'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'monthly'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'yearly'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), FieldNode( name: NameNode(value: '__typename'), alias: null, @@ -356,6 +406,7 @@ class Fragment$genericBackupConfigReturn$configuration { this.autobackupPeriod, this.locationName, this.locationId, + required this.autobackupQuotas, this.$__typename = 'BackupConfiguration', }); @@ -367,6 +418,7 @@ class Fragment$genericBackupConfigReturn$configuration { final l$autobackupPeriod = json['autobackupPeriod']; final l$locationName = json['locationName']; final l$locationId = json['locationId']; + final l$autobackupQuotas = json['autobackupQuotas']; final l$$__typename = json['__typename']; return Fragment$genericBackupConfigReturn$configuration( provider: fromJson$Enum$BackupProvider((l$provider as String)), @@ -375,6 +427,9 @@ class Fragment$genericBackupConfigReturn$configuration { autobackupPeriod: (l$autobackupPeriod as int?), locationName: (l$locationName as String?), locationId: (l$locationId as String?), + autobackupQuotas: + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas + .fromJson((l$autobackupQuotas as Map)), $__typename: (l$$__typename as String), ); } @@ -391,6 +446,9 @@ class Fragment$genericBackupConfigReturn$configuration { final String? locationId; + final Fragment$genericBackupConfigReturn$configuration$autobackupQuotas + autobackupQuotas; + final String $__typename; Map toJson() { @@ -407,6 +465,8 @@ class Fragment$genericBackupConfigReturn$configuration { _resultData['locationName'] = l$locationName; final l$locationId = locationId; _resultData['locationId'] = l$locationId; + final l$autobackupQuotas = autobackupQuotas; + _resultData['autobackupQuotas'] = l$autobackupQuotas.toJson(); final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; return _resultData; @@ -420,6 +480,7 @@ class Fragment$genericBackupConfigReturn$configuration { final l$autobackupPeriod = autobackupPeriod; final l$locationName = locationName; final l$locationId = locationId; + final l$autobackupQuotas = autobackupQuotas; final l$$__typename = $__typename; return Object.hashAll([ l$provider, @@ -428,6 +489,7 @@ class Fragment$genericBackupConfigReturn$configuration { l$autobackupPeriod, l$locationName, l$locationId, + l$autobackupQuotas, l$$__typename, ]); } @@ -471,6 +533,11 @@ class Fragment$genericBackupConfigReturn$configuration { if (l$locationId != lOther$locationId) { return false; } + final l$autobackupQuotas = autobackupQuotas; + final lOther$autobackupQuotas = other.autobackupQuotas; + if (l$autobackupQuotas != lOther$autobackupQuotas) { + return false; + } final l$$__typename = $__typename; final lOther$$__typename = other.$__typename; if (l$$__typename != lOther$$__typename) { @@ -507,8 +574,12 @@ abstract class CopyWith$Fragment$genericBackupConfigReturn$configuration { int? autobackupPeriod, String? locationName, String? locationId, + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas? + autobackupQuotas, String? $__typename, }); + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> get autobackupQuotas; } class _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration @@ -531,6 +602,7 @@ class _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration Object? autobackupPeriod = _undefined, Object? locationName = _undefined, Object? locationId = _undefined, + Object? autobackupQuotas = _undefined, Object? $__typename = _undefined, }) => _then(Fragment$genericBackupConfigReturn$configuration( @@ -552,10 +624,21 @@ class _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration locationId: locationId == _undefined ? _instance.locationId : (locationId as String?), + autobackupQuotas: autobackupQuotas == _undefined || + autobackupQuotas == null + ? _instance.autobackupQuotas + : (autobackupQuotas + as Fragment$genericBackupConfigReturn$configuration$autobackupQuotas), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> get autobackupQuotas { + final local$autobackupQuotas = _instance.autobackupQuotas; + return CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas( + local$autobackupQuotas, (e) => call(autobackupQuotas: e)); + } } class _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration @@ -571,6 +654,234 @@ class _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration int? autobackupPeriod, String? locationName, String? locationId, + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas? + autobackupQuotas, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> + get autobackupQuotas => + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas + .stub(_res); +} + +class Fragment$genericBackupConfigReturn$configuration$autobackupQuotas { + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas({ + required this.last, + required this.daily, + required this.weekly, + required this.monthly, + required this.yearly, + this.$__typename = 'AutobackupQuotas', + }); + + factory Fragment$genericBackupConfigReturn$configuration$autobackupQuotas.fromJson( + Map json) { + final l$last = json['last']; + final l$daily = json['daily']; + final l$weekly = json['weekly']; + final l$monthly = json['monthly']; + final l$yearly = json['yearly']; + final l$$__typename = json['__typename']; + return Fragment$genericBackupConfigReturn$configuration$autobackupQuotas( + last: (l$last as int), + daily: (l$daily as int), + weekly: (l$weekly as int), + monthly: (l$monthly as int), + yearly: (l$yearly as int), + $__typename: (l$$__typename as String), + ); + } + + final int last; + + final int daily; + + final int weekly; + + final int monthly; + + final int yearly; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$last = last; + _resultData['last'] = l$last; + final l$daily = daily; + _resultData['daily'] = l$daily; + final l$weekly = weekly; + _resultData['weekly'] = l$weekly; + final l$monthly = monthly; + _resultData['monthly'] = l$monthly; + final l$yearly = yearly; + _resultData['yearly'] = l$yearly; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$last = last; + final l$daily = daily; + final l$weekly = weekly; + final l$monthly = monthly; + final l$yearly = yearly; + final l$$__typename = $__typename; + return Object.hashAll([ + l$last, + l$daily, + l$weekly, + l$monthly, + l$yearly, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Fragment$genericBackupConfigReturn$configuration$autobackupQuotas) || + runtimeType != other.runtimeType) { + return false; + } + final l$last = last; + final lOther$last = other.last; + if (l$last != lOther$last) { + return false; + } + final l$daily = daily; + final lOther$daily = other.daily; + if (l$daily != lOther$daily) { + return false; + } + final l$weekly = weekly; + final lOther$weekly = other.weekly; + if (l$weekly != lOther$weekly) { + return false; + } + final l$monthly = monthly; + final lOther$monthly = other.monthly; + if (l$monthly != lOther$monthly) { + return false; + } + final l$yearly = yearly; + final lOther$yearly = other.yearly; + if (l$yearly != lOther$yearly) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas + on Fragment$genericBackupConfigReturn$configuration$autobackupQuotas { + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas> + get copyWith => + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas( + this, + (i) => i, + ); +} + +abstract class CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> { + factory CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas( + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas instance, + TRes Function( + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas) + then, + ) = _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas; + + factory CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas.stub( + TRes res) = + _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas; + + TRes call({ + int? last, + int? daily, + int? weekly, + int? monthly, + int? yearly, + String? $__typename, + }); +} + +class _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> + implements + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> { + _CopyWithImpl$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas( + this._instance, + this._then, + ); + + final Fragment$genericBackupConfigReturn$configuration$autobackupQuotas + _instance; + + final TRes Function( + Fragment$genericBackupConfigReturn$configuration$autobackupQuotas) _then; + + static const _undefined = {}; + + TRes call({ + Object? last = _undefined, + Object? daily = _undefined, + Object? weekly = _undefined, + Object? monthly = _undefined, + Object? yearly = _undefined, + Object? $__typename = _undefined, + }) => + _then(Fragment$genericBackupConfigReturn$configuration$autobackupQuotas( + last: + last == _undefined || last == null ? _instance.last : (last as int), + daily: daily == _undefined || daily == null + ? _instance.daily + : (daily as int), + weekly: weekly == _undefined || weekly == null + ? _instance.weekly + : (weekly as int), + monthly: monthly == _undefined || monthly == null + ? _instance.monthly + : (monthly as int), + yearly: yearly == _undefined || yearly == null + ? _instance.yearly + : (yearly as int), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> + implements + CopyWith$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas< + TRes> { + _CopyWithStubImpl$Fragment$genericBackupConfigReturn$configuration$autobackupQuotas( + this._res); + + TRes _res; + + call({ + int? last, + int? daily, + int? weekly, + int? monthly, + int? yearly, String? $__typename, }) => _res; @@ -771,6 +1082,56 @@ const documentNodeQueryBackupConfiguration = DocumentNode(definitions: [ directives: [], selectionSet: null, ), + FieldNode( + name: NameNode(value: 'autobackupQuotas'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'last'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'daily'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'weekly'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'monthly'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: 'yearly'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), FieldNode( name: NameNode(value: '__typename'), alias: null, @@ -1070,6 +1431,7 @@ class Query$BackupConfiguration$backup$configuration { this.locationId, this.locationName, required this.provider, + required this.autobackupQuotas, this.$__typename = 'BackupConfiguration', }); @@ -1081,6 +1443,7 @@ class Query$BackupConfiguration$backup$configuration { final l$locationId = json['locationId']; final l$locationName = json['locationName']; final l$provider = json['provider']; + final l$autobackupQuotas = json['autobackupQuotas']; final l$$__typename = json['__typename']; return Query$BackupConfiguration$backup$configuration( autobackupPeriod: (l$autobackupPeriod as int?), @@ -1089,6 +1452,9 @@ class Query$BackupConfiguration$backup$configuration { locationId: (l$locationId as String?), locationName: (l$locationName as String?), provider: fromJson$Enum$BackupProvider((l$provider as String)), + autobackupQuotas: + Query$BackupConfiguration$backup$configuration$autobackupQuotas + .fromJson((l$autobackupQuotas as Map)), $__typename: (l$$__typename as String), ); } @@ -1105,6 +1471,9 @@ class Query$BackupConfiguration$backup$configuration { final Enum$BackupProvider provider; + final Query$BackupConfiguration$backup$configuration$autobackupQuotas + autobackupQuotas; + final String $__typename; Map toJson() { @@ -1121,6 +1490,8 @@ class Query$BackupConfiguration$backup$configuration { _resultData['locationName'] = l$locationName; final l$provider = provider; _resultData['provider'] = toJson$Enum$BackupProvider(l$provider); + final l$autobackupQuotas = autobackupQuotas; + _resultData['autobackupQuotas'] = l$autobackupQuotas.toJson(); final l$$__typename = $__typename; _resultData['__typename'] = l$$__typename; return _resultData; @@ -1134,6 +1505,7 @@ class Query$BackupConfiguration$backup$configuration { final l$locationId = locationId; final l$locationName = locationName; final l$provider = provider; + final l$autobackupQuotas = autobackupQuotas; final l$$__typename = $__typename; return Object.hashAll([ l$autobackupPeriod, @@ -1142,6 +1514,7 @@ class Query$BackupConfiguration$backup$configuration { l$locationId, l$locationName, l$provider, + l$autobackupQuotas, l$$__typename, ]); } @@ -1185,6 +1558,11 @@ class Query$BackupConfiguration$backup$configuration { if (l$provider != lOther$provider) { return false; } + final l$autobackupQuotas = autobackupQuotas; + final lOther$autobackupQuotas = other.autobackupQuotas; + if (l$autobackupQuotas != lOther$autobackupQuotas) { + return false; + } final l$$__typename = $__typename; final lOther$$__typename = other.$__typename; if (l$$__typename != lOther$$__typename) { @@ -1221,8 +1599,12 @@ abstract class CopyWith$Query$BackupConfiguration$backup$configuration { String? locationId, String? locationName, Enum$BackupProvider? provider, + Query$BackupConfiguration$backup$configuration$autobackupQuotas? + autobackupQuotas, String? $__typename, }); + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas + get autobackupQuotas; } class _CopyWithImpl$Query$BackupConfiguration$backup$configuration @@ -1245,6 +1627,7 @@ class _CopyWithImpl$Query$BackupConfiguration$backup$configuration Object? locationId = _undefined, Object? locationName = _undefined, Object? provider = _undefined, + Object? autobackupQuotas = _undefined, Object? $__typename = _undefined, }) => _then(Query$BackupConfiguration$backup$configuration( @@ -1266,10 +1649,21 @@ class _CopyWithImpl$Query$BackupConfiguration$backup$configuration provider: provider == _undefined || provider == null ? _instance.provider : (provider as Enum$BackupProvider), + autobackupQuotas: autobackupQuotas == _undefined || + autobackupQuotas == null + ? _instance.autobackupQuotas + : (autobackupQuotas + as Query$BackupConfiguration$backup$configuration$autobackupQuotas), $__typename: $__typename == _undefined || $__typename == null ? _instance.$__typename : ($__typename as String), )); + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas + get autobackupQuotas { + final local$autobackupQuotas = _instance.autobackupQuotas; + return CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas( + local$autobackupQuotas, (e) => call(autobackupQuotas: e)); + } } class _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration @@ -1285,6 +1679,233 @@ class _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration String? locationId, String? locationName, Enum$BackupProvider? provider, + Query$BackupConfiguration$backup$configuration$autobackupQuotas? + autobackupQuotas, + String? $__typename, + }) => + _res; + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas + get autobackupQuotas => + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas + .stub(_res); +} + +class Query$BackupConfiguration$backup$configuration$autobackupQuotas { + Query$BackupConfiguration$backup$configuration$autobackupQuotas({ + required this.last, + required this.daily, + required this.weekly, + required this.monthly, + required this.yearly, + this.$__typename = 'AutobackupQuotas', + }); + + factory Query$BackupConfiguration$backup$configuration$autobackupQuotas.fromJson( + Map json) { + final l$last = json['last']; + final l$daily = json['daily']; + final l$weekly = json['weekly']; + final l$monthly = json['monthly']; + final l$yearly = json['yearly']; + final l$$__typename = json['__typename']; + return Query$BackupConfiguration$backup$configuration$autobackupQuotas( + last: (l$last as int), + daily: (l$daily as int), + weekly: (l$weekly as int), + monthly: (l$monthly as int), + yearly: (l$yearly as int), + $__typename: (l$$__typename as String), + ); + } + + final int last; + + final int daily; + + final int weekly; + + final int monthly; + + final int yearly; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$last = last; + _resultData['last'] = l$last; + final l$daily = daily; + _resultData['daily'] = l$daily; + final l$weekly = weekly; + _resultData['weekly'] = l$weekly; + final l$monthly = monthly; + _resultData['monthly'] = l$monthly; + final l$yearly = yearly; + _resultData['yearly'] = l$yearly; + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$last = last; + final l$daily = daily; + final l$weekly = weekly; + final l$monthly = monthly; + final l$yearly = yearly; + final l$$__typename = $__typename; + return Object.hashAll([ + l$last, + l$daily, + l$weekly, + l$monthly, + l$yearly, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other + is Query$BackupConfiguration$backup$configuration$autobackupQuotas) || + runtimeType != other.runtimeType) { + return false; + } + final l$last = last; + final lOther$last = other.last; + if (l$last != lOther$last) { + return false; + } + final l$daily = daily; + final lOther$daily = other.daily; + if (l$daily != lOther$daily) { + return false; + } + final l$weekly = weekly; + final lOther$weekly = other.weekly; + if (l$weekly != lOther$weekly) { + return false; + } + final l$monthly = monthly; + final lOther$monthly = other.monthly; + if (l$monthly != lOther$monthly) { + return false; + } + final l$yearly = yearly; + final lOther$yearly = other.yearly; + if (l$yearly != lOther$yearly) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Query$BackupConfiguration$backup$configuration$autobackupQuotas + on Query$BackupConfiguration$backup$configuration$autobackupQuotas { + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas< + Query$BackupConfiguration$backup$configuration$autobackupQuotas> + get copyWith => + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas( + this, + (i) => i, + ); +} + +abstract class CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas< + TRes> { + factory CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas( + Query$BackupConfiguration$backup$configuration$autobackupQuotas instance, + TRes Function( + Query$BackupConfiguration$backup$configuration$autobackupQuotas) + then, + ) = _CopyWithImpl$Query$BackupConfiguration$backup$configuration$autobackupQuotas; + + factory CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas.stub( + TRes res) = + _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration$autobackupQuotas; + + TRes call({ + int? last, + int? daily, + int? weekly, + int? monthly, + int? yearly, + String? $__typename, + }); +} + +class _CopyWithImpl$Query$BackupConfiguration$backup$configuration$autobackupQuotas< + TRes> + implements + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas< + TRes> { + _CopyWithImpl$Query$BackupConfiguration$backup$configuration$autobackupQuotas( + this._instance, + this._then, + ); + + final Query$BackupConfiguration$backup$configuration$autobackupQuotas + _instance; + + final TRes Function( + Query$BackupConfiguration$backup$configuration$autobackupQuotas) _then; + + static const _undefined = {}; + + TRes call({ + Object? last = _undefined, + Object? daily = _undefined, + Object? weekly = _undefined, + Object? monthly = _undefined, + Object? yearly = _undefined, + Object? $__typename = _undefined, + }) => + _then(Query$BackupConfiguration$backup$configuration$autobackupQuotas( + last: + last == _undefined || last == null ? _instance.last : (last as int), + daily: daily == _undefined || daily == null + ? _instance.daily + : (daily as int), + weekly: weekly == _undefined || weekly == null + ? _instance.weekly + : (weekly as int), + monthly: monthly == _undefined || monthly == null + ? _instance.monthly + : (monthly as int), + yearly: yearly == _undefined || yearly == null + ? _instance.yearly + : (yearly as int), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); +} + +class _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration$autobackupQuotas< + TRes> + implements + CopyWith$Query$BackupConfiguration$backup$configuration$autobackupQuotas< + TRes> { + _CopyWithStubImpl$Query$BackupConfiguration$backup$configuration$autobackupQuotas( + this._res); + + TRes _res; + + call({ + int? last, + int? daily, + int? weekly, + int? monthly, + int? yearly, String? $__typename, }) => _res; @@ -4051,6 +4672,546 @@ class _CopyWithStubImpl$Mutation$SetAutobackupPeriod$backup CopyWith$Fragment$genericBackupConfigReturn.stub(_res); } +class Variables$Mutation$setAutobackupQuotas { + factory Variables$Mutation$setAutobackupQuotas( + {required Input$AutobackupQuotasInput quotas}) => + Variables$Mutation$setAutobackupQuotas._({ + r'quotas': quotas, + }); + + Variables$Mutation$setAutobackupQuotas._(this._$data); + + factory Variables$Mutation$setAutobackupQuotas.fromJson( + Map data) { + final result$data = {}; + final l$quotas = data['quotas']; + result$data['quotas'] = Input$AutobackupQuotasInput.fromJson( + (l$quotas as Map)); + return Variables$Mutation$setAutobackupQuotas._(result$data); + } + + Map _$data; + + Input$AutobackupQuotasInput get quotas => + (_$data['quotas'] as Input$AutobackupQuotasInput); + Map toJson() { + final result$data = {}; + final l$quotas = quotas; + result$data['quotas'] = l$quotas.toJson(); + return result$data; + } + + CopyWith$Variables$Mutation$setAutobackupQuotas< + Variables$Mutation$setAutobackupQuotas> + get copyWith => CopyWith$Variables$Mutation$setAutobackupQuotas( + this, + (i) => i, + ); + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Variables$Mutation$setAutobackupQuotas) || + runtimeType != other.runtimeType) { + return false; + } + final l$quotas = quotas; + final lOther$quotas = other.quotas; + if (l$quotas != lOther$quotas) { + return false; + } + return true; + } + + @override + int get hashCode { + final l$quotas = quotas; + return Object.hashAll([l$quotas]); + } +} + +abstract class CopyWith$Variables$Mutation$setAutobackupQuotas { + factory CopyWith$Variables$Mutation$setAutobackupQuotas( + Variables$Mutation$setAutobackupQuotas instance, + TRes Function(Variables$Mutation$setAutobackupQuotas) then, + ) = _CopyWithImpl$Variables$Mutation$setAutobackupQuotas; + + factory CopyWith$Variables$Mutation$setAutobackupQuotas.stub(TRes res) = + _CopyWithStubImpl$Variables$Mutation$setAutobackupQuotas; + + TRes call({Input$AutobackupQuotasInput? quotas}); +} + +class _CopyWithImpl$Variables$Mutation$setAutobackupQuotas + implements CopyWith$Variables$Mutation$setAutobackupQuotas { + _CopyWithImpl$Variables$Mutation$setAutobackupQuotas( + this._instance, + this._then, + ); + + final Variables$Mutation$setAutobackupQuotas _instance; + + final TRes Function(Variables$Mutation$setAutobackupQuotas) _then; + + static const _undefined = {}; + + TRes call({Object? quotas = _undefined}) => + _then(Variables$Mutation$setAutobackupQuotas._({ + ..._instance._$data, + if (quotas != _undefined && quotas != null) + 'quotas': (quotas as Input$AutobackupQuotasInput), + })); +} + +class _CopyWithStubImpl$Variables$Mutation$setAutobackupQuotas + implements CopyWith$Variables$Mutation$setAutobackupQuotas { + _CopyWithStubImpl$Variables$Mutation$setAutobackupQuotas(this._res); + + TRes _res; + + call({Input$AutobackupQuotasInput? quotas}) => _res; +} + +class Mutation$setAutobackupQuotas { + Mutation$setAutobackupQuotas({ + required this.backup, + this.$__typename = 'Mutation', + }); + + factory Mutation$setAutobackupQuotas.fromJson(Map json) { + final l$backup = json['backup']; + final l$$__typename = json['__typename']; + return Mutation$setAutobackupQuotas( + backup: Mutation$setAutobackupQuotas$backup.fromJson( + (l$backup as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Mutation$setAutobackupQuotas$backup backup; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$backup = backup; + _resultData['backup'] = l$backup.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$backup = backup; + final l$$__typename = $__typename; + return Object.hashAll([ + l$backup, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$setAutobackupQuotas) || + runtimeType != other.runtimeType) { + return false; + } + final l$backup = backup; + final lOther$backup = other.backup; + if (l$backup != lOther$backup) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$setAutobackupQuotas + on Mutation$setAutobackupQuotas { + CopyWith$Mutation$setAutobackupQuotas + get copyWith => CopyWith$Mutation$setAutobackupQuotas( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$setAutobackupQuotas { + factory CopyWith$Mutation$setAutobackupQuotas( + Mutation$setAutobackupQuotas instance, + TRes Function(Mutation$setAutobackupQuotas) then, + ) = _CopyWithImpl$Mutation$setAutobackupQuotas; + + factory CopyWith$Mutation$setAutobackupQuotas.stub(TRes res) = + _CopyWithStubImpl$Mutation$setAutobackupQuotas; + + TRes call({ + Mutation$setAutobackupQuotas$backup? backup, + String? $__typename, + }); + CopyWith$Mutation$setAutobackupQuotas$backup get backup; +} + +class _CopyWithImpl$Mutation$setAutobackupQuotas + implements CopyWith$Mutation$setAutobackupQuotas { + _CopyWithImpl$Mutation$setAutobackupQuotas( + this._instance, + this._then, + ); + + final Mutation$setAutobackupQuotas _instance; + + final TRes Function(Mutation$setAutobackupQuotas) _then; + + static const _undefined = {}; + + TRes call({ + Object? backup = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$setAutobackupQuotas( + backup: backup == _undefined || backup == null + ? _instance.backup + : (backup as Mutation$setAutobackupQuotas$backup), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Mutation$setAutobackupQuotas$backup get backup { + final local$backup = _instance.backup; + return CopyWith$Mutation$setAutobackupQuotas$backup( + local$backup, (e) => call(backup: e)); + } +} + +class _CopyWithStubImpl$Mutation$setAutobackupQuotas + implements CopyWith$Mutation$setAutobackupQuotas { + _CopyWithStubImpl$Mutation$setAutobackupQuotas(this._res); + + TRes _res; + + call({ + Mutation$setAutobackupQuotas$backup? backup, + String? $__typename, + }) => + _res; + CopyWith$Mutation$setAutobackupQuotas$backup get backup => + CopyWith$Mutation$setAutobackupQuotas$backup.stub(_res); +} + +const documentNodeMutationsetAutobackupQuotas = DocumentNode(definitions: [ + OperationDefinitionNode( + type: OperationType.mutation, + name: NameNode(value: 'setAutobackupQuotas'), + variableDefinitions: [ + VariableDefinitionNode( + variable: VariableNode(name: NameNode(value: 'quotas')), + type: NamedTypeNode( + name: NameNode(value: 'AutobackupQuotasInput'), + isNonNull: true, + ), + defaultValue: DefaultValueNode(value: null), + directives: [], + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'backup'), + alias: null, + arguments: [], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FieldNode( + name: NameNode(value: 'setAutobackupQuotas'), + alias: null, + arguments: [ + ArgumentNode( + name: NameNode(value: 'quotas'), + value: VariableNode(name: NameNode(value: 'quotas')), + ) + ], + directives: [], + selectionSet: SelectionSetNode(selections: [ + FragmentSpreadNode( + name: NameNode(value: 'genericBackupConfigReturn'), + directives: [], + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + FieldNode( + name: NameNode(value: '__typename'), + alias: null, + arguments: [], + directives: [], + selectionSet: null, + ), + ]), + ), + fragmentDefinitiongenericBackupConfigReturn, +]); +Mutation$setAutobackupQuotas _parserFn$Mutation$setAutobackupQuotas( + Map data) => + Mutation$setAutobackupQuotas.fromJson(data); +typedef OnMutationCompleted$Mutation$setAutobackupQuotas = FutureOr + Function( + Map?, + Mutation$setAutobackupQuotas?, +); + +class Options$Mutation$setAutobackupQuotas + extends graphql.MutationOptions { + Options$Mutation$setAutobackupQuotas({ + String? operationName, + required Variables$Mutation$setAutobackupQuotas variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$setAutobackupQuotas? typedOptimisticResult, + graphql.Context? context, + OnMutationCompleted$Mutation$setAutobackupQuotas? onCompleted, + graphql.OnMutationUpdate? update, + graphql.OnError? onError, + }) : onCompletedWithParsed = onCompleted, + super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + onCompleted: onCompleted == null + ? null + : (data) => onCompleted( + data, + data == null + ? null + : _parserFn$Mutation$setAutobackupQuotas(data), + ), + update: update, + onError: onError, + document: documentNodeMutationsetAutobackupQuotas, + parserFn: _parserFn$Mutation$setAutobackupQuotas, + ); + + final OnMutationCompleted$Mutation$setAutobackupQuotas? onCompletedWithParsed; + + @override + List get properties => [ + ...super.onCompleted == null + ? super.properties + : super.properties.where((property) => property != onCompleted), + onCompletedWithParsed, + ]; +} + +class WatchOptions$Mutation$setAutobackupQuotas + extends graphql.WatchQueryOptions { + WatchOptions$Mutation$setAutobackupQuotas({ + String? operationName, + required Variables$Mutation$setAutobackupQuotas variables, + graphql.FetchPolicy? fetchPolicy, + graphql.ErrorPolicy? errorPolicy, + graphql.CacheRereadPolicy? cacheRereadPolicy, + Object? optimisticResult, + Mutation$setAutobackupQuotas? typedOptimisticResult, + graphql.Context? context, + Duration? pollInterval, + bool? eagerlyFetchResults, + bool carryForwardDataOnException = true, + bool fetchResults = false, + }) : super( + variables: variables.toJson(), + operationName: operationName, + fetchPolicy: fetchPolicy, + errorPolicy: errorPolicy, + cacheRereadPolicy: cacheRereadPolicy, + optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(), + context: context, + document: documentNodeMutationsetAutobackupQuotas, + pollInterval: pollInterval, + eagerlyFetchResults: eagerlyFetchResults, + carryForwardDataOnException: carryForwardDataOnException, + fetchResults: fetchResults, + parserFn: _parserFn$Mutation$setAutobackupQuotas, + ); +} + +extension ClientExtension$Mutation$setAutobackupQuotas + on graphql.GraphQLClient { + Future> + mutate$setAutobackupQuotas( + Options$Mutation$setAutobackupQuotas options) async => + await this.mutate(options); + graphql.ObservableQuery + watchMutation$setAutobackupQuotas( + WatchOptions$Mutation$setAutobackupQuotas options) => + this.watchMutation(options); +} + +class Mutation$setAutobackupQuotas$backup { + Mutation$setAutobackupQuotas$backup({ + required this.setAutobackupQuotas, + this.$__typename = 'BackupMutations', + }); + + factory Mutation$setAutobackupQuotas$backup.fromJson( + Map json) { + final l$setAutobackupQuotas = json['setAutobackupQuotas']; + final l$$__typename = json['__typename']; + return Mutation$setAutobackupQuotas$backup( + setAutobackupQuotas: Fragment$genericBackupConfigReturn.fromJson( + (l$setAutobackupQuotas as Map)), + $__typename: (l$$__typename as String), + ); + } + + final Fragment$genericBackupConfigReturn setAutobackupQuotas; + + final String $__typename; + + Map toJson() { + final _resultData = {}; + final l$setAutobackupQuotas = setAutobackupQuotas; + _resultData['setAutobackupQuotas'] = l$setAutobackupQuotas.toJson(); + final l$$__typename = $__typename; + _resultData['__typename'] = l$$__typename; + return _resultData; + } + + @override + int get hashCode { + final l$setAutobackupQuotas = setAutobackupQuotas; + final l$$__typename = $__typename; + return Object.hashAll([ + l$setAutobackupQuotas, + l$$__typename, + ]); + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) { + return true; + } + if (!(other is Mutation$setAutobackupQuotas$backup) || + runtimeType != other.runtimeType) { + return false; + } + final l$setAutobackupQuotas = setAutobackupQuotas; + final lOther$setAutobackupQuotas = other.setAutobackupQuotas; + if (l$setAutobackupQuotas != lOther$setAutobackupQuotas) { + return false; + } + final l$$__typename = $__typename; + final lOther$$__typename = other.$__typename; + if (l$$__typename != lOther$$__typename) { + return false; + } + return true; + } +} + +extension UtilityExtension$Mutation$setAutobackupQuotas$backup + on Mutation$setAutobackupQuotas$backup { + CopyWith$Mutation$setAutobackupQuotas$backup< + Mutation$setAutobackupQuotas$backup> + get copyWith => CopyWith$Mutation$setAutobackupQuotas$backup( + this, + (i) => i, + ); +} + +abstract class CopyWith$Mutation$setAutobackupQuotas$backup { + factory CopyWith$Mutation$setAutobackupQuotas$backup( + Mutation$setAutobackupQuotas$backup instance, + TRes Function(Mutation$setAutobackupQuotas$backup) then, + ) = _CopyWithImpl$Mutation$setAutobackupQuotas$backup; + + factory CopyWith$Mutation$setAutobackupQuotas$backup.stub(TRes res) = + _CopyWithStubImpl$Mutation$setAutobackupQuotas$backup; + + TRes call({ + Fragment$genericBackupConfigReturn? setAutobackupQuotas, + String? $__typename, + }); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupQuotas; +} + +class _CopyWithImpl$Mutation$setAutobackupQuotas$backup + implements CopyWith$Mutation$setAutobackupQuotas$backup { + _CopyWithImpl$Mutation$setAutobackupQuotas$backup( + this._instance, + this._then, + ); + + final Mutation$setAutobackupQuotas$backup _instance; + + final TRes Function(Mutation$setAutobackupQuotas$backup) _then; + + static const _undefined = {}; + + TRes call({ + Object? setAutobackupQuotas = _undefined, + Object? $__typename = _undefined, + }) => + _then(Mutation$setAutobackupQuotas$backup( + setAutobackupQuotas: + setAutobackupQuotas == _undefined || setAutobackupQuotas == null + ? _instance.setAutobackupQuotas + : (setAutobackupQuotas as Fragment$genericBackupConfigReturn), + $__typename: $__typename == _undefined || $__typename == null + ? _instance.$__typename + : ($__typename as String), + )); + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupQuotas { + final local$setAutobackupQuotas = _instance.setAutobackupQuotas; + return CopyWith$Fragment$genericBackupConfigReturn( + local$setAutobackupQuotas, (e) => call(setAutobackupQuotas: e)); + } +} + +class _CopyWithStubImpl$Mutation$setAutobackupQuotas$backup + implements CopyWith$Mutation$setAutobackupQuotas$backup { + _CopyWithStubImpl$Mutation$setAutobackupQuotas$backup(this._res); + + TRes _res; + + call({ + Fragment$genericBackupConfigReturn? setAutobackupQuotas, + String? $__typename, + }) => + _res; + CopyWith$Fragment$genericBackupConfigReturn get setAutobackupQuotas => + CopyWith$Fragment$genericBackupConfigReturn.stub(_res); +} + class Mutation$RemoveRepository { Mutation$RemoveRepository({ required this.backup, diff --git a/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart b/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart index ed54bd53..8e77d452 100644 --- a/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart +++ b/lib/logic/api_maps/graphql_maps/server_api/backups_api.dart @@ -143,6 +143,51 @@ mixin BackupsApi on GraphQLApiMap { return result; } + Future setAutobackupQuotas( + final AutobackupQuotas quotas, + ) async { + QueryResult response; + GenericResult? result; + + try { + final GraphQLClient client = await getClient(); + final variables = Variables$Mutation$setAutobackupQuotas( + quotas: Input$AutobackupQuotasInput( + last: quotas.last, + daily: quotas.daily, + weekly: quotas.weekly, + monthly: quotas.monthly, + yearly: quotas.yearly, + ), + ); + final options = + Options$Mutation$setAutobackupQuotas(variables: variables); + response = await client.mutate$setAutobackupQuotas(options); + if (response.hasException) { + final message = response.exception.toString(); + print(message); + result = GenericResult( + success: false, + data: null, + message: message, + ); + } + result = GenericResult( + success: true, + data: null, + ); + } catch (e) { + print(e); + result = GenericResult( + success: false, + data: null, + message: e.toString(), + ); + } + + return result; + } + Future removeRepository() async { try { final GraphQLClient client = await getClient(); diff --git a/lib/logic/cubit/backups/backups_cubit.dart b/lib/logic/cubit/backups/backups_cubit.dart index 89470656..ca7e0a50 100644 --- a/lib/logic/cubit/backups/backups_cubit.dart +++ b/lib/logic/cubit/backups/backups_cubit.dart @@ -36,6 +36,7 @@ class BackupsCubit extends ServerInstallationDependendCubit { backblazeBucket: bucket, isInitialized: backupConfig?.isInitialized, autobackupPeriod: backupConfig?.autobackupPeriod ?? Duration.zero, + autobackupQuotas: backupConfig?.autobackupQuotas, backups: backups, preventActions: false, refreshing: false, @@ -168,6 +169,7 @@ class BackupsCubit extends ServerInstallationDependendCubit { refreshing: false, isInitialized: backupConfig?.isInitialized ?? false, autobackupPeriod: backupConfig?.autobackupPeriod, + autobackupQuotas: backupConfig?.autobackupQuotas, ), ); if (useTimer) { @@ -227,6 +229,25 @@ class BackupsCubit extends ServerInstallationDependendCubit { await updateBackups(); } + Future setAutobackupQuotas(final AutobackupQuotas quotas) async { + emit(state.copyWith(preventActions: true)); + final result = await api.setAutobackupQuotas(quotas); + if (result.success == false) { + getIt() + .showSnackBar(result.message ?? 'Unknown error'); + emit(state.copyWith(preventActions: false)); + } else { + getIt().showSnackBar('backup.quotas_set'.tr()); + emit( + state.copyWith( + preventActions: false, + autobackupQuotas: quotas, + ), + ); + } + await updateBackups(); + } + Future forgetSnapshot(final String snapshotId) async { final result = await api.forgetSnapshot(snapshotId); if (!result.success) { diff --git a/lib/logic/cubit/backups/backups_state.dart b/lib/logic/cubit/backups/backups_state.dart index 52b9b106..887396d7 100644 --- a/lib/logic/cubit/backups/backups_state.dart +++ b/lib/logic/cubit/backups/backups_state.dart @@ -9,6 +9,7 @@ class BackupsState extends ServerInstallationDependendState { this.refreshing = true, this.autobackupPeriod, this.backblazeBucket, + this.autobackupQuotas, }); final bool isInitialized; @@ -18,6 +19,7 @@ class BackupsState extends ServerInstallationDependendState { final bool refreshing; final Duration? autobackupPeriod; final BackblazeBucket? backblazeBucket; + final AutobackupQuotas? autobackupQuotas; List serviceBackups(final String serviceId) => backups .where((final backup) => backup.serviceId == serviceId) @@ -40,6 +42,7 @@ class BackupsState extends ServerInstallationDependendState { final bool? refreshing, final Duration? autobackupPeriod, final BackblazeBucket? backblazeBucket, + final AutobackupQuotas? autobackupQuotas, }) => BackupsState( isInitialized: isInitialized ?? this.isInitialized, @@ -53,5 +56,6 @@ class BackupsState extends ServerInstallationDependendState { ? null : autobackupPeriod ?? this.autobackupPeriod, backblazeBucket: backblazeBucket ?? this.backblazeBucket, + autobackupQuotas: autobackupQuotas ?? this.autobackupQuotas, ); } diff --git a/lib/logic/models/backup.dart b/lib/logic/models/backup.dart index de5f9b44..1dcf9129 100644 --- a/lib/logic/models/backup.dart +++ b/lib/logic/models/backup.dart @@ -53,6 +53,9 @@ class BackupConfiguration { locationId: configuration.locationId, locationName: configuration.locationName, provider: BackupsProviderType.fromGraphQL(configuration.provider), + autobackupQuotas: AutobackupQuotas.fromGraphQL( + configuration.autobackupQuotas, + ), ); BackupConfiguration({ @@ -62,6 +65,7 @@ class BackupConfiguration { required this.locationId, required this.locationName, required this.provider, + required this.autobackupQuotas, }); final Duration? autobackupPeriod; @@ -70,6 +74,49 @@ class BackupConfiguration { final String? locationId; final String? locationName; final BackupsProviderType provider; + final AutobackupQuotas autobackupQuotas; +} + +class AutobackupQuotas { + AutobackupQuotas.fromGraphQL( + final Query$BackupConfiguration$backup$configuration$autobackupQuotas + autobackupQuotas, + ) : this( + last: autobackupQuotas.last, + daily: autobackupQuotas.daily, + weekly: autobackupQuotas.weekly, + monthly: autobackupQuotas.monthly, + yearly: autobackupQuotas.yearly, + ); + + AutobackupQuotas({ + required this.last, + required this.daily, + required this.weekly, + required this.monthly, + required this.yearly, + }); + + final int last; + final int daily; + final int weekly; + final int monthly; + final int yearly; + + AutobackupQuotas copyWith({ + final int? last, + final int? daily, + final int? weekly, + final int? monthly, + final int? yearly, + }) => + AutobackupQuotas( + last: last ?? this.last, + daily: daily ?? this.daily, + weekly: weekly ?? this.weekly, + monthly: monthly ?? this.monthly, + yearly: yearly ?? this.yearly, + ); } enum BackupRestoreStrategy { diff --git a/lib/ui/pages/backups/backup_details.dart b/lib/ui/pages/backups/backup_details.dart index 31f07e9d..344876b1 100644 --- a/lib/ui/pages/backups/backup_details.dart +++ b/lib/ui/pages/backups/backup_details.dart @@ -16,6 +16,7 @@ import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart'; import 'package:selfprivacy/ui/components/brand_icons/brand_icons.dart'; import 'package:selfprivacy/ui/helpers/modals.dart'; import 'package:selfprivacy/ui/pages/backups/change_period_modal.dart'; +import 'package:selfprivacy/ui/pages/backups/change_rotation_quotas_modal.dart'; import 'package:selfprivacy/ui/pages/backups/copy_encryption_key_modal.dart'; import 'package:selfprivacy/ui/pages/backups/create_backups_modal.dart'; import 'package:selfprivacy/ui/pages/backups/snapshot_modal.dart'; @@ -168,6 +169,38 @@ class BackupDetailsPage extends StatelessWidget { : 'backup.autobackup_period_never'.tr(), ), ), + ListTile( + onTap: preventActions + ? null + : () { + showModalBottomSheet( + useRootNavigator: true, + context: context, + isScrollControlled: true, + builder: (final BuildContext context) => + DraggableScrollableSheet( + expand: false, + maxChildSize: 0.9, + minChildSize: 0.4, + initialChildSize: 0.6, + builder: (final context, final scrollController) => + ChangeRotationQuotasModal( + scrollController: scrollController, + ), + ), + ); + }, + leading: Icon( + Icons.auto_delete_outlined, + color: overrideColor, + ), + title: Text( + 'backup.rotation_quotas_title'.tr(), + style: TextStyle( + color: overrideColor, + ), + ), + ), ListTile( onTap: preventActions ? null diff --git a/lib/ui/pages/backups/change_rotation_quotas_modal.dart b/lib/ui/pages/backups/change_rotation_quotas_modal.dart new file mode 100644 index 00000000..6d9cba8a --- /dev/null +++ b/lib/ui/pages/backups/change_rotation_quotas_modal.dart @@ -0,0 +1,244 @@ +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart'; +import 'package:selfprivacy/logic/cubit/backups/backups_cubit.dart'; +import 'package:selfprivacy/logic/cubit/server_jobs/server_jobs_cubit.dart'; +import 'package:selfprivacy/logic/models/backup.dart'; + +class ChangeRotationQuotasModal extends StatefulWidget { + const ChangeRotationQuotasModal({ + required this.scrollController, + super.key, + }); + + final ScrollController scrollController; + + @override + State createState() => + _ChangeRotationQuotasModalState(); +} + +enum QuotaUnits { + last, + daily, + weekly, + monthly, + yearly, +} + +class _ChangeRotationQuotasModalState extends State { + AutobackupQuotas selectedQuotas = AutobackupQuotas( + last: 3, + daily: 7, + weekly: 4, + monthly: 6, + yearly: -1, + ); + + // Set initial period to the one currently set + @override + void initState() { + super.initState(); + selectedQuotas = + context.read().state.autobackupQuotas ?? selectedQuotas; + } + + String generateSubtitle(final int value, final QuotaUnits unit) { + switch (unit) { + case QuotaUnits.last: + return value == -1 + ? 'backup.quota_subtitles.last_infinite'.tr() + : 'backup.quota_subtitles.last'.plural(value); + case QuotaUnits.daily: + if (selectedQuotas.last == -1) { + return 'backup.quota_subtitles.no_effect'.tr(); + } + return value == -1 + ? 'backup.quota_subtitles.daily_infinite'.tr() + : 'backup.quota_subtitles.daily'.plural(value); + case QuotaUnits.weekly: + if (selectedQuotas.last == -1 || selectedQuotas.daily == -1) { + return 'backup.quota_subtitles.no_effect'.tr(); + } + return value == -1 + ? 'backup.quota_subtitles.weekly_infinite'.tr() + : 'backup.quota_subtitles.weekly'.plural(value); + case QuotaUnits.monthly: + if (selectedQuotas.last == -1 || selectedQuotas.daily == -1) { + return 'backup.quota_subtitles.no_effect'.tr(); + } + return value == -1 + ? 'backup.quota_subtitles.monthly_infinite'.tr() + : 'backup.quota_subtitles.monthly'.plural(value); + case QuotaUnits.yearly: + if (selectedQuotas.last == -1 || selectedQuotas.daily == -1) { + return 'backup.quota_subtitles.no_effect'.tr(); + } + return value == -1 + ? 'backup.quota_subtitles.yearly_infinite'.tr() + : 'backup.quota_subtitles.yearly'.plural(value); + } + } + + @override + Widget build(final BuildContext context) { + final AutobackupQuotas? initialAutobackupQuotas = + context.watch().state.autobackupQuotas; + return ListView( + controller: widget.scrollController, + padding: const EdgeInsets.all(16), + children: [ + const SizedBox(height: 16), + Text( + 'backup.rotation_quotas_title'.tr(), + style: Theme.of(context).textTheme.headlineSmall, + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + // Accordions for each quota type. When tapped allows to enter a new int value + // for the quota. + QuotaSelectionTile( + title: 'backup.quota_titles.last'.tr(), + subtitle: generateSubtitle(selectedQuotas.last, QuotaUnits.last), + value: selectedQuotas.last, + min: 1, + max: 30, + callback: (final double value) { + setState(() { + if (value == 31) { + selectedQuotas = selectedQuotas.copyWith(last: -1); + return; + } + selectedQuotas = selectedQuotas.copyWith(last: value.toInt()); + }); + }, + ), + QuotaSelectionTile( + title: 'backup.quota_titles.daily'.tr(), + subtitle: generateSubtitle(selectedQuotas.daily, QuotaUnits.daily), + value: selectedQuotas.daily, + min: 0, + max: 30, + callback: (final double value) { + setState(() { + if (value == 31) { + selectedQuotas = selectedQuotas.copyWith(daily: -1); + return; + } + selectedQuotas = selectedQuotas.copyWith(daily: value.toInt()); + }); + }, + ), + QuotaSelectionTile( + title: 'backup.quota_titles.weekly'.tr(), + subtitle: generateSubtitle(selectedQuotas.weekly, QuotaUnits.weekly), + value: selectedQuotas.weekly, + min: 0, + max: 15, + callback: (final double value) { + setState(() { + if (value == 16) { + selectedQuotas = selectedQuotas.copyWith(weekly: -1); + return; + } + selectedQuotas = selectedQuotas.copyWith(weekly: value.toInt()); + }); + }, + ), + QuotaSelectionTile( + title: 'backup.quota_titles.monthly'.tr(), + subtitle: + generateSubtitle(selectedQuotas.monthly, QuotaUnits.monthly), + value: selectedQuotas.monthly, + min: 0, + max: 24, + callback: (final double value) { + setState(() { + if (value == 25) { + selectedQuotas = selectedQuotas.copyWith(monthly: -1); + return; + } + selectedQuotas = selectedQuotas.copyWith(monthly: value.toInt()); + }); + }, + ), + QuotaSelectionTile( + title: 'backup.quota_titles.yearly'.tr(), + subtitle: generateSubtitle(selectedQuotas.yearly, QuotaUnits.yearly), + value: selectedQuotas.yearly, + min: 0, + max: 5, + callback: (final double value) { + setState(() { + if (value == 6) { + selectedQuotas = selectedQuotas.copyWith(yearly: -1); + return; + } + selectedQuotas = selectedQuotas.copyWith(yearly: value.toInt()); + }); + }, + ), + const SizedBox(height: 16), + FilledButton( + onPressed: selectedQuotas == initialAutobackupQuotas + ? null + : () { + context + .read() + .setAutobackupQuotas(selectedQuotas); + Navigator.of(context).pop(); + }, + child: Text( + 'backup.set_rotation_quotas'.tr(), + ), + ), + ], + ); + } +} + +class QuotaSelectionTile extends StatelessWidget { + const QuotaSelectionTile({ + required this.title, + required this.subtitle, + required this.value, + required this.min, + required this.max, + required this.callback, + super.key, + }); + + final String title; + final String subtitle; + final int value; + final int min; + final int max; + final void Function(double) callback; + + @override + Widget build(final BuildContext context) => ExpansionTile( + title: Text(title), + subtitle: Text(subtitle), + trailing: Text( + value == -1 ? '∞' : value.toString(), + style: Theme.of(context).textTheme.headlineMedium, + ), + children: [ + // Discrete slider to select the new value + if (value >= -1 && value <= max) + Slider( + value: value == -1 ? max + 1 : value.toDouble(), + min: min.toDouble(), + max: (max + 1).toDouble(), + divisions: max - min + 1, + label: value == -1 ? '∞' : value.toString(), + onChanged: callback, + ), + if (value < -1 || value > max) + Text( + 'Manually set to $value', + style: Theme.of(context).textTheme.headlineSmall, + ), + ], + ); +} diff --git a/lib/ui/pages/setup/initializing/initializing.dart b/lib/ui/pages/setup/initializing/initializing.dart index 60088ea3..a681c07a 100644 --- a/lib/ui/pages/setup/initializing/initializing.dart +++ b/lib/ui/pages/setup/initializing/initializing.dart @@ -320,7 +320,7 @@ class InitializingPage extends StatelessWidget { Widget _stepDomain(final ServerInstallationCubit initializingCubit) => BlocProvider( create: (final context) => DomainSetupCubit(initializingCubit)..load(), - child: DomainPicker(), + child: const DomainPicker(), ); Widget _stepUser(final ServerInstallationCubit initializingCubit) => diff --git a/lib/ui/router/router.gr.dart b/lib/ui/router/router.gr.dart index dfc41363..a9d401f3 100644 --- a/lib/ui/router/router.gr.dart +++ b/lib/ui/router/router.gr.dart @@ -15,18 +15,6 @@ abstract class _$RootRouter extends RootStackRouter { @override final Map pagesMap = { - OnboardingRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const OnboardingPage(), - ); - }, - BackupDetailsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const BackupDetailsPage(), - ); - }, BackupsListRoute.name: (routeData) { final args = routeData.argsAs(); return AutoRoutePage( @@ -37,10 +25,58 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, - RecoveryKeyRoute.name: (routeData) { + BackupDetailsRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, - child: const RecoveryKeyPage(), + child: const BackupDetailsPage(), + ); + }, + DevicesRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const DevicesScreen(), + ); + }, + DnsDetailsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const DnsDetailsPage(), + ); + }, + AboutApplicationRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AboutApplicationPage(), + ); + }, + AppSettingsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const AppSettingsPage(), + ); + }, + DeveloperSettingsRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const DeveloperSettingsPage(), + ); + }, + ConsoleRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const ConsolePage(), + ); + }, + MoreRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const MorePage(), + ); + }, + OnboardingRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const OnboardingPage(), ); }, ProvidersRoute.name: (routeData) { @@ -49,6 +85,18 @@ abstract class _$RootRouter extends RootStackRouter { child: const ProvidersPage(), ); }, + RecoveryKeyRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const RecoveryKeyPage(), + ); + }, + RootRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: WrappedRoute(child: const RootPage()), + ); + }, ServerDetailsRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, @@ -67,17 +115,6 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, - ExtendingVolumeRoute.name: (routeData) { - final args = routeData.argsAs(); - return AutoRoutePage( - routeData: routeData, - child: ExtendingVolumePage( - diskVolumeToResize: args.diskVolumeToResize, - diskStatus: args.diskStatus, - key: args.key, - ), - ); - }, ServerStorageRoute.name: (routeData) { final args = routeData.argsAs(); return AutoRoutePage( @@ -88,52 +125,15 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, - DevicesRoute.name: (routeData) { + ExtendingVolumeRoute.name: (routeData) { + final args = routeData.argsAs(); return AutoRoutePage( routeData: routeData, - child: const DevicesScreen(), - ); - }, - RootRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: WrappedRoute(child: const RootPage()), - ); - }, - AboutApplicationRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const AboutApplicationPage(), - ); - }, - ConsoleRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const ConsolePage(), - ); - }, - MoreRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const MorePage(), - ); - }, - AppSettingsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const AppSettingsPage(), - ); - }, - DeveloperSettingsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const DeveloperSettingsPage(), - ); - }, - DnsDetailsRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const DnsDetailsPage(), + child: ExtendingVolumePage( + diskVolumeToResize: args.diskVolumeToResize, + diskStatus: args.diskStatus, + key: args.key, + ), ); }, ServiceRoute.name: (routeData) { @@ -152,6 +152,18 @@ abstract class _$RootRouter extends RootStackRouter { child: const ServicesPage(), ); }, + InitializingRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const InitializingPage(), + ); + }, + RecoveryRoute.name: (routeData) { + return AutoRoutePage( + routeData: routeData, + child: const RecoveryRouting(), + ); + }, UsersRoute.name: (routeData) { return AutoRoutePage( routeData: routeData, @@ -174,49 +186,9 @@ abstract class _$RootRouter extends RootStackRouter { ), ); }, - InitializingRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const InitializingPage(), - ); - }, - RecoveryRoute.name: (routeData) { - return AutoRoutePage( - routeData: routeData, - child: const RecoveryRouting(), - ); - }, }; } -/// generated route for -/// [OnboardingPage] -class OnboardingRoute extends PageRouteInfo { - const OnboardingRoute({List? children}) - : super( - OnboardingRoute.name, - initialChildren: children, - ); - - static const String name = 'OnboardingRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [BackupDetailsPage] -class BackupDetailsRoute extends PageRouteInfo { - const BackupDetailsRoute({List? children}) - : super( - BackupDetailsRoute.name, - initialChildren: children, - ); - - static const String name = 'BackupDetailsRoute'; - - static const PageInfo page = PageInfo(name); -} - /// generated route for /// [BackupsListPage] class BackupsListRoute extends PageRouteInfo { @@ -256,15 +228,127 @@ class BackupsListRouteArgs { } /// generated route for -/// [RecoveryKeyPage] -class RecoveryKeyRoute extends PageRouteInfo { - const RecoveryKeyRoute({List? children}) +/// [BackupDetailsPage] +class BackupDetailsRoute extends PageRouteInfo { + const BackupDetailsRoute({List? children}) : super( - RecoveryKeyRoute.name, + BackupDetailsRoute.name, initialChildren: children, ); - static const String name = 'RecoveryKeyRoute'; + static const String name = 'BackupDetailsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [DevicesScreen] +class DevicesRoute extends PageRouteInfo { + const DevicesRoute({List? children}) + : super( + DevicesRoute.name, + initialChildren: children, + ); + + static const String name = 'DevicesRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [DnsDetailsPage] +class DnsDetailsRoute extends PageRouteInfo { + const DnsDetailsRoute({List? children}) + : super( + DnsDetailsRoute.name, + initialChildren: children, + ); + + static const String name = 'DnsDetailsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AboutApplicationPage] +class AboutApplicationRoute extends PageRouteInfo { + const AboutApplicationRoute({List? children}) + : super( + AboutApplicationRoute.name, + initialChildren: children, + ); + + static const String name = 'AboutApplicationRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [AppSettingsPage] +class AppSettingsRoute extends PageRouteInfo { + const AppSettingsRoute({List? children}) + : super( + AppSettingsRoute.name, + initialChildren: children, + ); + + static const String name = 'AppSettingsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [DeveloperSettingsPage] +class DeveloperSettingsRoute extends PageRouteInfo { + const DeveloperSettingsRoute({List? children}) + : super( + DeveloperSettingsRoute.name, + initialChildren: children, + ); + + static const String name = 'DeveloperSettingsRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [ConsolePage] +class ConsoleRoute extends PageRouteInfo { + const ConsoleRoute({List? children}) + : super( + ConsoleRoute.name, + initialChildren: children, + ); + + static const String name = 'ConsoleRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [MorePage] +class MoreRoute extends PageRouteInfo { + const MoreRoute({List? children}) + : super( + MoreRoute.name, + initialChildren: children, + ); + + static const String name = 'MoreRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [OnboardingPage] +class OnboardingRoute extends PageRouteInfo { + const OnboardingRoute({List? children}) + : super( + OnboardingRoute.name, + initialChildren: children, + ); + + static const String name = 'OnboardingRoute'; static const PageInfo page = PageInfo(name); } @@ -283,6 +367,34 @@ class ProvidersRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [RecoveryKeyPage] +class RecoveryKeyRoute extends PageRouteInfo { + const RecoveryKeyRoute({List? children}) + : super( + RecoveryKeyRoute.name, + initialChildren: children, + ); + + static const String name = 'RecoveryKeyRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [RootPage] +class RootRoute extends PageRouteInfo { + const RootRoute({List? children}) + : super( + RootRoute.name, + initialChildren: children, + ); + + static const String name = 'RootRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [ServerDetailsScreen] class ServerDetailsRoute extends PageRouteInfo { @@ -345,6 +457,44 @@ class ServicesMigrationRouteArgs { } } +/// generated route for +/// [ServerStoragePage] +class ServerStorageRoute extends PageRouteInfo { + ServerStorageRoute({ + required DiskStatus diskStatus, + Key? key, + List? children, + }) : super( + ServerStorageRoute.name, + args: ServerStorageRouteArgs( + diskStatus: diskStatus, + key: key, + ), + initialChildren: children, + ); + + static const String name = 'ServerStorageRoute'; + + static const PageInfo page = + PageInfo(name); +} + +class ServerStorageRouteArgs { + const ServerStorageRouteArgs({ + required this.diskStatus, + this.key, + }); + + final DiskStatus diskStatus; + + final Key? key; + + @override + String toString() { + return 'ServerStorageRouteArgs{diskStatus: $diskStatus, key: $key}'; + } +} + /// generated route for /// [ExtendingVolumePage] class ExtendingVolumeRoute extends PageRouteInfo { @@ -388,156 +538,6 @@ class ExtendingVolumeRouteArgs { } } -/// generated route for -/// [ServerStoragePage] -class ServerStorageRoute extends PageRouteInfo { - ServerStorageRoute({ - required DiskStatus diskStatus, - Key? key, - List? children, - }) : super( - ServerStorageRoute.name, - args: ServerStorageRouteArgs( - diskStatus: diskStatus, - key: key, - ), - initialChildren: children, - ); - - static const String name = 'ServerStorageRoute'; - - static const PageInfo page = - PageInfo(name); -} - -class ServerStorageRouteArgs { - const ServerStorageRouteArgs({ - required this.diskStatus, - this.key, - }); - - final DiskStatus diskStatus; - - final Key? key; - - @override - String toString() { - return 'ServerStorageRouteArgs{diskStatus: $diskStatus, key: $key}'; - } -} - -/// generated route for -/// [DevicesScreen] -class DevicesRoute extends PageRouteInfo { - const DevicesRoute({List? children}) - : super( - DevicesRoute.name, - initialChildren: children, - ); - - static const String name = 'DevicesRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [RootPage] -class RootRoute extends PageRouteInfo { - const RootRoute({List? children}) - : super( - RootRoute.name, - initialChildren: children, - ); - - static const String name = 'RootRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [AboutApplicationPage] -class AboutApplicationRoute extends PageRouteInfo { - const AboutApplicationRoute({List? children}) - : super( - AboutApplicationRoute.name, - initialChildren: children, - ); - - static const String name = 'AboutApplicationRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [ConsolePage] -class ConsoleRoute extends PageRouteInfo { - const ConsoleRoute({List? children}) - : super( - ConsoleRoute.name, - initialChildren: children, - ); - - static const String name = 'ConsoleRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [MorePage] -class MoreRoute extends PageRouteInfo { - const MoreRoute({List? children}) - : super( - MoreRoute.name, - initialChildren: children, - ); - - static const String name = 'MoreRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [AppSettingsPage] -class AppSettingsRoute extends PageRouteInfo { - const AppSettingsRoute({List? children}) - : super( - AppSettingsRoute.name, - initialChildren: children, - ); - - static const String name = 'AppSettingsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [DeveloperSettingsPage] -class DeveloperSettingsRoute extends PageRouteInfo { - const DeveloperSettingsRoute({List? children}) - : super( - DeveloperSettingsRoute.name, - initialChildren: children, - ); - - static const String name = 'DeveloperSettingsRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [DnsDetailsPage] -class DnsDetailsRoute extends PageRouteInfo { - const DnsDetailsRoute({List? children}) - : super( - DnsDetailsRoute.name, - initialChildren: children, - ); - - static const String name = 'DnsDetailsRoute'; - - static const PageInfo page = PageInfo(name); -} - /// generated route for /// [ServicePage] class ServiceRoute extends PageRouteInfo { @@ -590,6 +590,34 @@ class ServicesRoute extends PageRouteInfo { static const PageInfo page = PageInfo(name); } +/// generated route for +/// [InitializingPage] +class InitializingRoute extends PageRouteInfo { + const InitializingRoute({List? children}) + : super( + InitializingRoute.name, + initialChildren: children, + ); + + static const String name = 'InitializingRoute'; + + static const PageInfo page = PageInfo(name); +} + +/// generated route for +/// [RecoveryRouting] +class RecoveryRoute extends PageRouteInfo { + const RecoveryRoute({List? children}) + : super( + RecoveryRoute.name, + initialChildren: children, + ); + + static const String name = 'RecoveryRoute'; + + static const PageInfo page = PageInfo(name); +} + /// generated route for /// [UsersPage] class UsersRoute extends PageRouteInfo { @@ -655,31 +683,3 @@ class UserDetailsRouteArgs { return 'UserDetailsRouteArgs{login: $login, key: $key}'; } } - -/// generated route for -/// [InitializingPage] -class InitializingRoute extends PageRouteInfo { - const InitializingRoute({List? children}) - : super( - InitializingRoute.name, - initialChildren: children, - ); - - static const String name = 'InitializingRoute'; - - static const PageInfo page = PageInfo(name); -} - -/// generated route for -/// [RecoveryRouting] -class RecoveryRoute extends PageRouteInfo { - const RecoveryRoute({List? children}) - : super( - RecoveryRoute.name, - initialChildren: children, - ); - - static const String name = 'RecoveryRoute'; - - static const PageInfo page = PageInfo(name); -}