mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-09 09:31:13 +00:00
fix: Adjust graphql schemas to new dns provider
- fix runtime bugs
This commit is contained in:
parent
01c09aaae4
commit
c67e37a40e
|
@ -3,6 +3,7 @@ import 'package:gql/ast.dart';
|
||||||
import 'package:graphql/client.dart' as graphql;
|
import 'package:graphql/client.dart' as graphql;
|
||||||
import 'package:selfprivacy/utils/scalars.dart';
|
import 'package:selfprivacy/utils/scalars.dart';
|
||||||
import 'schema.graphql.dart';
|
import 'schema.graphql.dart';
|
||||||
|
import 'services.graphql.dart';
|
||||||
|
|
||||||
class Fragment$basicMutationReturnFields {
|
class Fragment$basicMutationReturnFields {
|
||||||
Fragment$basicMutationReturnFields({
|
Fragment$basicMutationReturnFields({
|
||||||
|
|
|
@ -75,7 +75,8 @@ type DeviceApiTokenMutationReturn implements MutationReturnInterface {
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DnsProvider {
|
enum DnsProvider {
|
||||||
CLOUDFLARE
|
CLOUDFLARE,
|
||||||
|
DESEC
|
||||||
}
|
}
|
||||||
|
|
||||||
type DnsRecord {
|
type DnsRecord {
|
||||||
|
|
|
@ -1096,12 +1096,14 @@ class _CopyWithStubImpl$Input$UserMutationInput<TRes>
|
||||||
_res;
|
_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Enum$DnsProvider { CLOUDFLARE, $unknown }
|
enum Enum$DnsProvider { CLOUDFLARE, DESEC, $unknown }
|
||||||
|
|
||||||
String toJson$Enum$DnsProvider(Enum$DnsProvider e) {
|
String toJson$Enum$DnsProvider(Enum$DnsProvider e) {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case Enum$DnsProvider.CLOUDFLARE:
|
case Enum$DnsProvider.CLOUDFLARE:
|
||||||
return r'CLOUDFLARE';
|
return r'CLOUDFLARE';
|
||||||
|
case Enum$DnsProvider.DESEC:
|
||||||
|
return r'DESEC';
|
||||||
case Enum$DnsProvider.$unknown:
|
case Enum$DnsProvider.$unknown:
|
||||||
return r'$unknown';
|
return r'$unknown';
|
||||||
}
|
}
|
||||||
|
@ -1111,6 +1113,8 @@ Enum$DnsProvider fromJson$Enum$DnsProvider(String value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case r'CLOUDFLARE':
|
case r'CLOUDFLARE':
|
||||||
return Enum$DnsProvider.CLOUDFLARE;
|
return Enum$DnsProvider.CLOUDFLARE;
|
||||||
|
case r'DESEC':
|
||||||
|
return Enum$DnsProvider.DESEC;
|
||||||
default:
|
default:
|
||||||
return Enum$DnsProvider.$unknown;
|
return Enum$DnsProvider.$unknown;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,15 @@ query SystemServerProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query SystemDnsProvider {
|
||||||
|
system {
|
||||||
|
domainInfo {
|
||||||
|
provider
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
query GetApiTokens {
|
query GetApiTokens {
|
||||||
api {
|
api {
|
||||||
devices {
|
devices {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'disk_volumes.graphql.dart';
|
|
||||||
import 'package:gql/ast.dart';
|
import 'package:gql/ast.dart';
|
||||||
import 'package:graphql/client.dart' as graphql;
|
import 'package:graphql/client.dart' as graphql;
|
||||||
import 'package:selfprivacy/utils/scalars.dart';
|
import 'package:selfprivacy/utils/scalars.dart';
|
||||||
import 'schema.graphql.dart';
|
import 'schema.graphql.dart';
|
||||||
|
import 'services.graphql.dart';
|
||||||
|
|
||||||
class Fragment$basicMutationReturnFields {
|
class Fragment$basicMutationReturnFields {
|
||||||
Fragment$basicMutationReturnFields({
|
Fragment$basicMutationReturnFields({
|
||||||
|
@ -6380,6 +6380,550 @@ class _CopyWithStubImpl$Query$SystemServerProvider$system$provider<TRes>
|
||||||
_res;
|
_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Query$SystemDnsProvider {
|
||||||
|
Query$SystemDnsProvider({
|
||||||
|
required this.system,
|
||||||
|
required this.$__typename,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Query$SystemDnsProvider.fromJson(Map<String, dynamic> json) {
|
||||||
|
final l$system = json['system'];
|
||||||
|
final l$$__typename = json['__typename'];
|
||||||
|
return Query$SystemDnsProvider(
|
||||||
|
system: Query$SystemDnsProvider$system.fromJson(
|
||||||
|
(l$system as Map<String, dynamic>)),
|
||||||
|
$__typename: (l$$__typename as String),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Query$SystemDnsProvider$system system;
|
||||||
|
|
||||||
|
final String $__typename;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final _resultData = <String, dynamic>{};
|
||||||
|
final l$system = system;
|
||||||
|
_resultData['system'] = l$system.toJson();
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
_resultData['__typename'] = l$$__typename;
|
||||||
|
return _resultData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
final l$system = system;
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
return Object.hashAll([
|
||||||
|
l$system,
|
||||||
|
l$$__typename,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
if (identical(this, other)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(other is Query$SystemDnsProvider) ||
|
||||||
|
runtimeType != other.runtimeType) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final l$system = system;
|
||||||
|
final lOther$system = other.system;
|
||||||
|
if (l$system != lOther$system) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
final lOther$$__typename = other.$__typename;
|
||||||
|
if (l$$__typename != lOther$$__typename) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension UtilityExtension$Query$SystemDnsProvider on Query$SystemDnsProvider {
|
||||||
|
CopyWith$Query$SystemDnsProvider<Query$SystemDnsProvider> get copyWith =>
|
||||||
|
CopyWith$Query$SystemDnsProvider(
|
||||||
|
this,
|
||||||
|
(i) => i,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class CopyWith$Query$SystemDnsProvider<TRes> {
|
||||||
|
factory CopyWith$Query$SystemDnsProvider(
|
||||||
|
Query$SystemDnsProvider instance,
|
||||||
|
TRes Function(Query$SystemDnsProvider) then,
|
||||||
|
) = _CopyWithImpl$Query$SystemDnsProvider;
|
||||||
|
|
||||||
|
factory CopyWith$Query$SystemDnsProvider.stub(TRes res) =
|
||||||
|
_CopyWithStubImpl$Query$SystemDnsProvider;
|
||||||
|
|
||||||
|
TRes call({
|
||||||
|
Query$SystemDnsProvider$system? system,
|
||||||
|
String? $__typename,
|
||||||
|
});
|
||||||
|
CopyWith$Query$SystemDnsProvider$system<TRes> get system;
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CopyWithImpl$Query$SystemDnsProvider<TRes>
|
||||||
|
implements CopyWith$Query$SystemDnsProvider<TRes> {
|
||||||
|
_CopyWithImpl$Query$SystemDnsProvider(
|
||||||
|
this._instance,
|
||||||
|
this._then,
|
||||||
|
);
|
||||||
|
|
||||||
|
final Query$SystemDnsProvider _instance;
|
||||||
|
|
||||||
|
final TRes Function(Query$SystemDnsProvider) _then;
|
||||||
|
|
||||||
|
static const _undefined = {};
|
||||||
|
|
||||||
|
TRes call({
|
||||||
|
Object? system = _undefined,
|
||||||
|
Object? $__typename = _undefined,
|
||||||
|
}) =>
|
||||||
|
_then(Query$SystemDnsProvider(
|
||||||
|
system: system == _undefined || system == null
|
||||||
|
? _instance.system
|
||||||
|
: (system as Query$SystemDnsProvider$system),
|
||||||
|
$__typename: $__typename == _undefined || $__typename == null
|
||||||
|
? _instance.$__typename
|
||||||
|
: ($__typename as String),
|
||||||
|
));
|
||||||
|
CopyWith$Query$SystemDnsProvider$system<TRes> get system {
|
||||||
|
final local$system = _instance.system;
|
||||||
|
return CopyWith$Query$SystemDnsProvider$system(
|
||||||
|
local$system, (e) => call(system: e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CopyWithStubImpl$Query$SystemDnsProvider<TRes>
|
||||||
|
implements CopyWith$Query$SystemDnsProvider<TRes> {
|
||||||
|
_CopyWithStubImpl$Query$SystemDnsProvider(this._res);
|
||||||
|
|
||||||
|
TRes _res;
|
||||||
|
|
||||||
|
call({
|
||||||
|
Query$SystemDnsProvider$system? system,
|
||||||
|
String? $__typename,
|
||||||
|
}) =>
|
||||||
|
_res;
|
||||||
|
CopyWith$Query$SystemDnsProvider$system<TRes> get system =>
|
||||||
|
CopyWith$Query$SystemDnsProvider$system.stub(_res);
|
||||||
|
}
|
||||||
|
|
||||||
|
const documentNodeQuerySystemDnsProvider = DocumentNode(definitions: [
|
||||||
|
OperationDefinitionNode(
|
||||||
|
type: OperationType.query,
|
||||||
|
name: NameNode(value: 'SystemDnsProvider'),
|
||||||
|
variableDefinitions: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: SelectionSetNode(selections: [
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'system'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: SelectionSetNode(selections: [
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'domainInfo'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: SelectionSetNode(selections: [
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: 'provider'),
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
FieldNode(
|
||||||
|
name: NameNode(value: '__typename'),
|
||||||
|
alias: null,
|
||||||
|
arguments: [],
|
||||||
|
directives: [],
|
||||||
|
selectionSet: null,
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
Query$SystemDnsProvider _parserFn$Query$SystemDnsProvider(
|
||||||
|
Map<String, dynamic> data) =>
|
||||||
|
Query$SystemDnsProvider.fromJson(data);
|
||||||
|
|
||||||
|
class Options$Query$SystemDnsProvider
|
||||||
|
extends graphql.QueryOptions<Query$SystemDnsProvider> {
|
||||||
|
Options$Query$SystemDnsProvider({
|
||||||
|
String? operationName,
|
||||||
|
graphql.FetchPolicy? fetchPolicy,
|
||||||
|
graphql.ErrorPolicy? errorPolicy,
|
||||||
|
graphql.CacheRereadPolicy? cacheRereadPolicy,
|
||||||
|
Object? optimisticResult,
|
||||||
|
Duration? pollInterval,
|
||||||
|
graphql.Context? context,
|
||||||
|
}) : super(
|
||||||
|
operationName: operationName,
|
||||||
|
fetchPolicy: fetchPolicy,
|
||||||
|
errorPolicy: errorPolicy,
|
||||||
|
cacheRereadPolicy: cacheRereadPolicy,
|
||||||
|
optimisticResult: optimisticResult,
|
||||||
|
pollInterval: pollInterval,
|
||||||
|
context: context,
|
||||||
|
document: documentNodeQuerySystemDnsProvider,
|
||||||
|
parserFn: _parserFn$Query$SystemDnsProvider,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class WatchOptions$Query$SystemDnsProvider
|
||||||
|
extends graphql.WatchQueryOptions<Query$SystemDnsProvider> {
|
||||||
|
WatchOptions$Query$SystemDnsProvider({
|
||||||
|
String? operationName,
|
||||||
|
graphql.FetchPolicy? fetchPolicy,
|
||||||
|
graphql.ErrorPolicy? errorPolicy,
|
||||||
|
graphql.CacheRereadPolicy? cacheRereadPolicy,
|
||||||
|
Object? optimisticResult,
|
||||||
|
graphql.Context? context,
|
||||||
|
Duration? pollInterval,
|
||||||
|
bool? eagerlyFetchResults,
|
||||||
|
bool carryForwardDataOnException = true,
|
||||||
|
bool fetchResults = false,
|
||||||
|
}) : super(
|
||||||
|
operationName: operationName,
|
||||||
|
fetchPolicy: fetchPolicy,
|
||||||
|
errorPolicy: errorPolicy,
|
||||||
|
cacheRereadPolicy: cacheRereadPolicy,
|
||||||
|
optimisticResult: optimisticResult,
|
||||||
|
context: context,
|
||||||
|
document: documentNodeQuerySystemDnsProvider,
|
||||||
|
pollInterval: pollInterval,
|
||||||
|
eagerlyFetchResults: eagerlyFetchResults,
|
||||||
|
carryForwardDataOnException: carryForwardDataOnException,
|
||||||
|
fetchResults: fetchResults,
|
||||||
|
parserFn: _parserFn$Query$SystemDnsProvider,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class FetchMoreOptions$Query$SystemDnsProvider
|
||||||
|
extends graphql.FetchMoreOptions {
|
||||||
|
FetchMoreOptions$Query$SystemDnsProvider(
|
||||||
|
{required graphql.UpdateQuery updateQuery})
|
||||||
|
: super(
|
||||||
|
updateQuery: updateQuery,
|
||||||
|
document: documentNodeQuerySystemDnsProvider,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
extension ClientExtension$Query$SystemDnsProvider on graphql.GraphQLClient {
|
||||||
|
Future<graphql.QueryResult<Query$SystemDnsProvider>> query$SystemDnsProvider(
|
||||||
|
[Options$Query$SystemDnsProvider? options]) async =>
|
||||||
|
await this.query(options ?? Options$Query$SystemDnsProvider());
|
||||||
|
graphql.ObservableQuery<Query$SystemDnsProvider> watchQuery$SystemDnsProvider(
|
||||||
|
[WatchOptions$Query$SystemDnsProvider? options]) =>
|
||||||
|
this.watchQuery(options ?? WatchOptions$Query$SystemDnsProvider());
|
||||||
|
void writeQuery$SystemDnsProvider({
|
||||||
|
required Query$SystemDnsProvider data,
|
||||||
|
bool broadcast = true,
|
||||||
|
}) =>
|
||||||
|
this.writeQuery(
|
||||||
|
graphql.Request(
|
||||||
|
operation: graphql.Operation(
|
||||||
|
document: documentNodeQuerySystemDnsProvider)),
|
||||||
|
data: data.toJson(),
|
||||||
|
broadcast: broadcast,
|
||||||
|
);
|
||||||
|
Query$SystemDnsProvider? readQuery$SystemDnsProvider(
|
||||||
|
{bool optimistic = true}) {
|
||||||
|
final result = this.readQuery(
|
||||||
|
graphql.Request(
|
||||||
|
operation:
|
||||||
|
graphql.Operation(document: documentNodeQuerySystemDnsProvider)),
|
||||||
|
optimistic: optimistic,
|
||||||
|
);
|
||||||
|
return result == null ? null : Query$SystemDnsProvider.fromJson(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Query$SystemDnsProvider$system {
|
||||||
|
Query$SystemDnsProvider$system({
|
||||||
|
required this.domainInfo,
|
||||||
|
required this.$__typename,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Query$SystemDnsProvider$system.fromJson(Map<String, dynamic> json) {
|
||||||
|
final l$domainInfo = json['domainInfo'];
|
||||||
|
final l$$__typename = json['__typename'];
|
||||||
|
return Query$SystemDnsProvider$system(
|
||||||
|
domainInfo: Query$SystemDnsProvider$system$domainInfo.fromJson(
|
||||||
|
(l$domainInfo as Map<String, dynamic>)),
|
||||||
|
$__typename: (l$$__typename as String),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Query$SystemDnsProvider$system$domainInfo domainInfo;
|
||||||
|
|
||||||
|
final String $__typename;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final _resultData = <String, dynamic>{};
|
||||||
|
final l$domainInfo = domainInfo;
|
||||||
|
_resultData['domainInfo'] = l$domainInfo.toJson();
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
_resultData['__typename'] = l$$__typename;
|
||||||
|
return _resultData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
final l$domainInfo = domainInfo;
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
return Object.hashAll([
|
||||||
|
l$domainInfo,
|
||||||
|
l$$__typename,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
if (identical(this, other)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(other is Query$SystemDnsProvider$system) ||
|
||||||
|
runtimeType != other.runtimeType) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final l$domainInfo = domainInfo;
|
||||||
|
final lOther$domainInfo = other.domainInfo;
|
||||||
|
if (l$domainInfo != lOther$domainInfo) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
final lOther$$__typename = other.$__typename;
|
||||||
|
if (l$$__typename != lOther$$__typename) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension UtilityExtension$Query$SystemDnsProvider$system
|
||||||
|
on Query$SystemDnsProvider$system {
|
||||||
|
CopyWith$Query$SystemDnsProvider$system<Query$SystemDnsProvider$system>
|
||||||
|
get copyWith => CopyWith$Query$SystemDnsProvider$system(
|
||||||
|
this,
|
||||||
|
(i) => i,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class CopyWith$Query$SystemDnsProvider$system<TRes> {
|
||||||
|
factory CopyWith$Query$SystemDnsProvider$system(
|
||||||
|
Query$SystemDnsProvider$system instance,
|
||||||
|
TRes Function(Query$SystemDnsProvider$system) then,
|
||||||
|
) = _CopyWithImpl$Query$SystemDnsProvider$system;
|
||||||
|
|
||||||
|
factory CopyWith$Query$SystemDnsProvider$system.stub(TRes res) =
|
||||||
|
_CopyWithStubImpl$Query$SystemDnsProvider$system;
|
||||||
|
|
||||||
|
TRes call({
|
||||||
|
Query$SystemDnsProvider$system$domainInfo? domainInfo,
|
||||||
|
String? $__typename,
|
||||||
|
});
|
||||||
|
CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> get domainInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CopyWithImpl$Query$SystemDnsProvider$system<TRes>
|
||||||
|
implements CopyWith$Query$SystemDnsProvider$system<TRes> {
|
||||||
|
_CopyWithImpl$Query$SystemDnsProvider$system(
|
||||||
|
this._instance,
|
||||||
|
this._then,
|
||||||
|
);
|
||||||
|
|
||||||
|
final Query$SystemDnsProvider$system _instance;
|
||||||
|
|
||||||
|
final TRes Function(Query$SystemDnsProvider$system) _then;
|
||||||
|
|
||||||
|
static const _undefined = {};
|
||||||
|
|
||||||
|
TRes call({
|
||||||
|
Object? domainInfo = _undefined,
|
||||||
|
Object? $__typename = _undefined,
|
||||||
|
}) =>
|
||||||
|
_then(Query$SystemDnsProvider$system(
|
||||||
|
domainInfo: domainInfo == _undefined || domainInfo == null
|
||||||
|
? _instance.domainInfo
|
||||||
|
: (domainInfo as Query$SystemDnsProvider$system$domainInfo),
|
||||||
|
$__typename: $__typename == _undefined || $__typename == null
|
||||||
|
? _instance.$__typename
|
||||||
|
: ($__typename as String),
|
||||||
|
));
|
||||||
|
CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> get domainInfo {
|
||||||
|
final local$domainInfo = _instance.domainInfo;
|
||||||
|
return CopyWith$Query$SystemDnsProvider$system$domainInfo(
|
||||||
|
local$domainInfo, (e) => call(domainInfo: e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CopyWithStubImpl$Query$SystemDnsProvider$system<TRes>
|
||||||
|
implements CopyWith$Query$SystemDnsProvider$system<TRes> {
|
||||||
|
_CopyWithStubImpl$Query$SystemDnsProvider$system(this._res);
|
||||||
|
|
||||||
|
TRes _res;
|
||||||
|
|
||||||
|
call({
|
||||||
|
Query$SystemDnsProvider$system$domainInfo? domainInfo,
|
||||||
|
String? $__typename,
|
||||||
|
}) =>
|
||||||
|
_res;
|
||||||
|
CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> get domainInfo =>
|
||||||
|
CopyWith$Query$SystemDnsProvider$system$domainInfo.stub(_res);
|
||||||
|
}
|
||||||
|
|
||||||
|
class Query$SystemDnsProvider$system$domainInfo {
|
||||||
|
Query$SystemDnsProvider$system$domainInfo({
|
||||||
|
required this.provider,
|
||||||
|
required this.$__typename,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Query$SystemDnsProvider$system$domainInfo.fromJson(
|
||||||
|
Map<String, dynamic> json) {
|
||||||
|
final l$provider = json['provider'];
|
||||||
|
final l$$__typename = json['__typename'];
|
||||||
|
return Query$SystemDnsProvider$system$domainInfo(
|
||||||
|
provider: fromJson$Enum$DnsProvider((l$provider as String)),
|
||||||
|
$__typename: (l$$__typename as String),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Enum$DnsProvider provider;
|
||||||
|
|
||||||
|
final String $__typename;
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final _resultData = <String, dynamic>{};
|
||||||
|
final l$provider = provider;
|
||||||
|
_resultData['provider'] = toJson$Enum$DnsProvider(l$provider);
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
_resultData['__typename'] = l$$__typename;
|
||||||
|
return _resultData;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode {
|
||||||
|
final l$provider = provider;
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
return Object.hashAll([
|
||||||
|
l$provider,
|
||||||
|
l$$__typename,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) {
|
||||||
|
if (identical(this, other)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!(other is Query$SystemDnsProvider$system$domainInfo) ||
|
||||||
|
runtimeType != other.runtimeType) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final l$provider = provider;
|
||||||
|
final lOther$provider = other.provider;
|
||||||
|
if (l$provider != lOther$provider) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
final l$$__typename = $__typename;
|
||||||
|
final lOther$$__typename = other.$__typename;
|
||||||
|
if (l$$__typename != lOther$$__typename) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension UtilityExtension$Query$SystemDnsProvider$system$domainInfo
|
||||||
|
on Query$SystemDnsProvider$system$domainInfo {
|
||||||
|
CopyWith$Query$SystemDnsProvider$system$domainInfo<
|
||||||
|
Query$SystemDnsProvider$system$domainInfo>
|
||||||
|
get copyWith => CopyWith$Query$SystemDnsProvider$system$domainInfo(
|
||||||
|
this,
|
||||||
|
(i) => i,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> {
|
||||||
|
factory CopyWith$Query$SystemDnsProvider$system$domainInfo(
|
||||||
|
Query$SystemDnsProvider$system$domainInfo instance,
|
||||||
|
TRes Function(Query$SystemDnsProvider$system$domainInfo) then,
|
||||||
|
) = _CopyWithImpl$Query$SystemDnsProvider$system$domainInfo;
|
||||||
|
|
||||||
|
factory CopyWith$Query$SystemDnsProvider$system$domainInfo.stub(TRes res) =
|
||||||
|
_CopyWithStubImpl$Query$SystemDnsProvider$system$domainInfo;
|
||||||
|
|
||||||
|
TRes call({
|
||||||
|
Enum$DnsProvider? provider,
|
||||||
|
String? $__typename,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CopyWithImpl$Query$SystemDnsProvider$system$domainInfo<TRes>
|
||||||
|
implements CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> {
|
||||||
|
_CopyWithImpl$Query$SystemDnsProvider$system$domainInfo(
|
||||||
|
this._instance,
|
||||||
|
this._then,
|
||||||
|
);
|
||||||
|
|
||||||
|
final Query$SystemDnsProvider$system$domainInfo _instance;
|
||||||
|
|
||||||
|
final TRes Function(Query$SystemDnsProvider$system$domainInfo) _then;
|
||||||
|
|
||||||
|
static const _undefined = {};
|
||||||
|
|
||||||
|
TRes call({
|
||||||
|
Object? provider = _undefined,
|
||||||
|
Object? $__typename = _undefined,
|
||||||
|
}) =>
|
||||||
|
_then(Query$SystemDnsProvider$system$domainInfo(
|
||||||
|
provider: provider == _undefined || provider == null
|
||||||
|
? _instance.provider
|
||||||
|
: (provider as Enum$DnsProvider),
|
||||||
|
$__typename: $__typename == _undefined || $__typename == null
|
||||||
|
? _instance.$__typename
|
||||||
|
: ($__typename as String),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CopyWithStubImpl$Query$SystemDnsProvider$system$domainInfo<TRes>
|
||||||
|
implements CopyWith$Query$SystemDnsProvider$system$domainInfo<TRes> {
|
||||||
|
_CopyWithStubImpl$Query$SystemDnsProvider$system$domainInfo(this._res);
|
||||||
|
|
||||||
|
TRes _res;
|
||||||
|
|
||||||
|
call({
|
||||||
|
Enum$DnsProvider? provider,
|
||||||
|
String? $__typename,
|
||||||
|
}) =>
|
||||||
|
_res;
|
||||||
|
}
|
||||||
|
|
||||||
class Query$GetApiTokens {
|
class Query$GetApiTokens {
|
||||||
Query$GetApiTokens({
|
Query$GetApiTokens({
|
||||||
required this.api,
|
required this.api,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'disk_volumes.graphql.dart';
|
|
||||||
import 'package:gql/ast.dart';
|
import 'package:gql/ast.dart';
|
||||||
import 'package:graphql/client.dart' as graphql;
|
import 'package:graphql/client.dart' as graphql;
|
||||||
import 'schema.graphql.dart';
|
import 'schema.graphql.dart';
|
||||||
|
import 'services.graphql.dart';
|
||||||
|
|
||||||
class Fragment$basicMutationReturnFields {
|
class Fragment$basicMutationReturnFields {
|
||||||
Fragment$basicMutationReturnFields({
|
Fragment$basicMutationReturnFields({
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'disk_volumes.graphql.dart';
|
|
||||||
import 'package:gql/ast.dart';
|
import 'package:gql/ast.dart';
|
||||||
import 'package:graphql/client.dart' as graphql;
|
import 'package:graphql/client.dart' as graphql;
|
||||||
import 'package:selfprivacy/utils/scalars.dart';
|
import 'package:selfprivacy/utils/scalars.dart';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'disk_volumes.graphql.dart';
|
|
||||||
import 'package:gql/ast.dart';
|
import 'package:gql/ast.dart';
|
||||||
import 'package:graphql/client.dart' as graphql;
|
import 'package:graphql/client.dart' as graphql;
|
||||||
import 'schema.graphql.dart';
|
import 'schema.graphql.dart';
|
||||||
|
import 'services.graphql.dart';
|
||||||
|
|
||||||
class Fragment$basicMutationReturnFields {
|
class Fragment$basicMutationReturnFields {
|
||||||
Fragment$basicMutationReturnFields({
|
Fragment$basicMutationReturnFields({
|
||||||
|
|
|
@ -11,6 +11,7 @@ import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/users.graphql.dar
|
||||||
import 'package:selfprivacy/logic/models/auto_upgrade_settings.dart';
|
import 'package:selfprivacy/logic/models/auto_upgrade_settings.dart';
|
||||||
import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart';
|
import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart';
|
||||||
import 'package:selfprivacy/logic/models/hive/server_details.dart';
|
import 'package:selfprivacy/logic/models/hive/server_details.dart';
|
||||||
|
import 'package:selfprivacy/logic/models/hive/server_domain.dart';
|
||||||
import 'package:selfprivacy/logic/models/hive/user.dart';
|
import 'package:selfprivacy/logic/models/hive/user.dart';
|
||||||
import 'package:selfprivacy/logic/models/json/api_token.dart';
|
import 'package:selfprivacy/logic/models/json/api_token.dart';
|
||||||
import 'package:selfprivacy/logic/models/json/backup.dart';
|
import 'package:selfprivacy/logic/models/json/backup.dart';
|
||||||
|
@ -87,6 +88,25 @@ class ServerApi extends ApiMap
|
||||||
return providerType;
|
return providerType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<DnsProvider> getDnsProviderType() async {
|
||||||
|
QueryResult<Query$SystemDnsProvider> response;
|
||||||
|
DnsProvider providerType = DnsProvider.unknown;
|
||||||
|
|
||||||
|
try {
|
||||||
|
final GraphQLClient client = await getClient();
|
||||||
|
response = await client.query$SystemDnsProvider();
|
||||||
|
if (response.hasException) {
|
||||||
|
print(response.exception.toString());
|
||||||
|
}
|
||||||
|
providerType = DnsProvider.fromGraphQL(
|
||||||
|
response.parsedData!.system.domainInfo.provider,
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
return providerType;
|
||||||
|
}
|
||||||
|
|
||||||
Future<bool> isUsingBinds() async {
|
Future<bool> isUsingBinds() async {
|
||||||
QueryResult response;
|
QueryResult response;
|
||||||
bool usesBinds = false;
|
bool usesBinds = false;
|
||||||
|
|
|
@ -27,7 +27,7 @@ class CloudflareApi extends DnsProviderApi {
|
||||||
BaseOptions get options {
|
BaseOptions get options {
|
||||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||||
if (isWithToken) {
|
if (isWithToken) {
|
||||||
final String? token = getIt<ApiConfigModel>().cloudFlareKey;
|
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||||
assert(token != null);
|
assert(token != null);
|
||||||
options.headers = {'Authorization': 'Bearer $token'};
|
options.headers = {'Authorization': 'Bearer $token'};
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,13 +27,13 @@ class DesecApi extends DnsProviderApi {
|
||||||
BaseOptions get options {
|
BaseOptions get options {
|
||||||
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
final BaseOptions options = BaseOptions(baseUrl: rootAddress);
|
||||||
if (isWithToken) {
|
if (isWithToken) {
|
||||||
final String? token = getIt<ApiConfigModel>().cloudFlareKey;
|
final String? token = getIt<ApiConfigModel>().dnsProviderKey;
|
||||||
assert(token != null);
|
assert(token != null);
|
||||||
options.headers = {'Authorization': 'Bearer $token'};
|
options.headers = {'Authorization': 'Token $token'};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (customToken != null) {
|
if (customToken != null) {
|
||||||
options.headers = {'Authorization': 'Bearer $customToken'};
|
options.headers = {'Authorization': 'Token $customToken'};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (validateStatus != null) {
|
if (validateStatus != null) {
|
||||||
|
@ -107,7 +107,7 @@ class DesecApi extends DnsProviderApi {
|
||||||
try {
|
try {
|
||||||
final Response response = await client.get(url);
|
final Response response = await client.get(url);
|
||||||
|
|
||||||
final List records = response.data['result'] ?? [];
|
final List records = response.data;
|
||||||
await client.put(url, data: records);
|
await client.put(url, data: records);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print(e);
|
print(e);
|
||||||
|
@ -136,7 +136,7 @@ class DesecApi extends DnsProviderApi {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
try {
|
try {
|
||||||
response = await client.get(url);
|
response = await client.get(url);
|
||||||
final List records = response.data['result'] ?? [];
|
final List records = response.data;
|
||||||
|
|
||||||
for (final record in records) {
|
for (final record in records) {
|
||||||
allRecords.add(
|
allRecords.add(
|
||||||
|
@ -291,7 +291,7 @@ class DesecApi extends DnsProviderApi {
|
||||||
final Response response = await client.get(
|
final Response response = await client.get(
|
||||||
'',
|
'',
|
||||||
);
|
);
|
||||||
domains = response.data['result']
|
domains = response.data
|
||||||
.map<String>((final el) => el['name'] as String)
|
.map<String>((final el) => el['name'] as String)
|
||||||
.toList();
|
.toList();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -332,6 +332,7 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
required final User rootUser,
|
required final User rootUser,
|
||||||
required final String domainName,
|
required final String domainName,
|
||||||
required final String serverType,
|
required final String serverType,
|
||||||
|
required final DnsProvider dnsProvider,
|
||||||
}) async {
|
}) async {
|
||||||
ServerHostingDetails? serverDetails;
|
ServerHostingDetails? serverDetails;
|
||||||
|
|
||||||
|
@ -344,9 +345,10 @@ class DigitalOceanApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final String formattedHostname = getHostnameFromDomain(domainName);
|
final String formattedHostname = getHostnameFromDomain(domainName);
|
||||||
const String infectBranch = 'providers/digital-ocean';
|
const String infectBranch = 'providers/digital-ocean';
|
||||||
final String stagingAcme = StagingOptions.stagingAcme ? 'true' : 'false';
|
final String stagingAcme = StagingOptions.stagingAcme ? 'true' : 'false';
|
||||||
|
final String dnsProviderType = dnsProviderToInfectName(dnsProvider);
|
||||||
|
|
||||||
final String userdataString =
|
final String userdataString =
|
||||||
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | PROVIDER=$infectProviderName STAGING_ACME='$stagingAcme' DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$formattedHostname bash 2>&1 | tee /tmp/infect.log";
|
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | DNS_PROVIDER_TYPE=$dnsProviderType PROVIDER=$infectProviderName STAGING_ACME='$stagingAcme' DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$formattedHostname bash 2>&1 | tee /tmp/infect.log";
|
||||||
print(userdataString);
|
print(userdataString);
|
||||||
|
|
||||||
Response? serverCreateResponse;
|
Response? serverCreateResponse;
|
||||||
|
|
|
@ -356,6 +356,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
required final User rootUser,
|
required final User rootUser,
|
||||||
required final String domainName,
|
required final String domainName,
|
||||||
required final String serverType,
|
required final String serverType,
|
||||||
|
required final DnsProvider dnsProvider,
|
||||||
}) async {
|
}) async {
|
||||||
final APIGenericResult<ServerVolume?> newVolumeResponse =
|
final APIGenericResult<ServerVolume?> newVolumeResponse =
|
||||||
await createVolume();
|
await createVolume();
|
||||||
|
@ -374,6 +375,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
volume: newVolumeResponse.data!,
|
volume: newVolumeResponse.data!,
|
||||||
serverType: serverType,
|
serverType: serverType,
|
||||||
|
dnsProvider: dnsProvider,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,6 +385,7 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
required final String domainName,
|
required final String domainName,
|
||||||
required final ServerVolume volume,
|
required final ServerVolume volume,
|
||||||
required final String serverType,
|
required final String serverType,
|
||||||
|
required final DnsProvider dnsProvider,
|
||||||
}) async {
|
}) async {
|
||||||
final Dio client = await getClient();
|
final Dio client = await getClient();
|
||||||
|
|
||||||
|
@ -395,9 +398,10 @@ class HetznerApi extends ServerProviderApi with VolumeProviderApi {
|
||||||
final String stagingAcme = StagingOptions.stagingAcme ? 'true' : 'false';
|
final String stagingAcme = StagingOptions.stagingAcme ? 'true' : 'false';
|
||||||
final String base64Password =
|
final String base64Password =
|
||||||
base64.encode(utf8.encode(rootUser.password ?? 'PASS'));
|
base64.encode(utf8.encode(rootUser.password ?? 'PASS'));
|
||||||
|
final String dnsProviderType = dnsProviderToInfectName(dnsProvider);
|
||||||
|
|
||||||
final String userdataString =
|
final String userdataString =
|
||||||
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | STAGING_ACME='$stagingAcme' PROVIDER=$infectProviderName NIX_CHANNEL=nixos-21.05 DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$hostname bash 2>&1 | tee /tmp/infect.log";
|
"#cloud-config\nruncmd:\n- curl https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-infect/raw/branch/$infectBranch/nixos-infect | DNS_PROVIDER_TYPE=$dnsProviderType STAGING_ACME='$stagingAcme' PROVIDER=$infectProviderName NIX_CHANNEL=nixos-21.05 DOMAIN='$domainName' LUSER='${rootUser.login}' ENCODED_PASSWORD='$base64Password' CF_TOKEN=$dnsApiToken DB_PASSWORD=$dbPassword API_TOKEN=$apiToken HOSTNAME=$hostname bash 2>&1 | tee /tmp/infect.log";
|
||||||
|
|
||||||
Response? serverCreateResponse;
|
Response? serverCreateResponse;
|
||||||
ServerHostingDetails? serverDetails;
|
ServerHostingDetails? serverDetails;
|
||||||
|
|
|
@ -39,6 +39,7 @@ abstract class ServerProviderApi extends ApiMap {
|
||||||
required final User rootUser,
|
required final User rootUser,
|
||||||
required final String domainName,
|
required final String domainName,
|
||||||
required final String serverType,
|
required final String serverType,
|
||||||
|
required final DnsProvider dnsProvider,
|
||||||
});
|
});
|
||||||
Future<APIGenericResult<void>> createReverseDns({
|
Future<APIGenericResult<void>> createReverseDns({
|
||||||
required final ServerHostingDetails serverDetails,
|
required final ServerHostingDetails serverDetails,
|
||||||
|
@ -54,6 +55,20 @@ abstract class ServerProviderApi extends ApiMap {
|
||||||
final DateTime end,
|
final DateTime end,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
String dnsProviderToInfectName(final DnsProvider dnsProvider) {
|
||||||
|
String dnsProviderType;
|
||||||
|
switch (dnsProvider) {
|
||||||
|
case DnsProvider.desec:
|
||||||
|
dnsProviderType = 'DESEC';
|
||||||
|
break;
|
||||||
|
case DnsProvider.cloudflare:
|
||||||
|
default:
|
||||||
|
dnsProviderType = 'CLOUDFLARE';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return dnsProviderType;
|
||||||
|
}
|
||||||
|
|
||||||
/// Provider name key which lets infect understand what kind of installation
|
/// Provider name key which lets infect understand what kind of installation
|
||||||
/// it requires, for example 'digitaloceal' for Digital Ocean
|
/// it requires, for example 'digitaloceal' for Digital Ocean
|
||||||
String get infectProviderName;
|
String get infectProviderName;
|
||||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
||||||
import 'package:cubit_form/cubit_form.dart';
|
import 'package:cubit_form/cubit_form.dart';
|
||||||
import 'package:easy_localization/easy_localization.dart';
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||||
import 'package:selfprivacy/logic/cubit/forms/validations/validations.dart';
|
|
||||||
|
|
||||||
class DnsProviderFormCubit extends FormCubit {
|
class DnsProviderFormCubit extends FormCubit {
|
||||||
DnsProviderFormCubit(this.initializingCubit) {
|
DnsProviderFormCubit(this.initializingCubit) {
|
||||||
|
@ -11,7 +10,6 @@ class DnsProviderFormCubit extends FormCubit {
|
||||||
initalValue: '',
|
initalValue: '',
|
||||||
validations: [
|
validations: [
|
||||||
RequiredStringValidation('validations.required'.tr()),
|
RequiredStringValidation('validations.required'.tr()),
|
||||||
LengthStringNotEqualValidation(40)
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -20,7 +18,7 @@ class DnsProviderFormCubit extends FormCubit {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
FutureOr<void> onSubmit() async {
|
FutureOr<void> onSubmit() async {
|
||||||
initializingCubit.setCloudflareKey(apiKey.state.value);
|
initializingCubit.setDnsApiToken(apiKey.state.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
final ServerInstallationCubit initializingCubit;
|
final ServerInstallationCubit initializingCubit;
|
||||||
|
|
|
@ -110,16 +110,6 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
Future<bool?> isDnsProviderApiTokenValid(
|
Future<bool?> isDnsProviderApiTokenValid(
|
||||||
final String providerToken,
|
final String providerToken,
|
||||||
) async {
|
) async {
|
||||||
if (ApiController.currentDnsProviderApiFactory == null) {
|
|
||||||
// No other DNS provider is supported for now,
|
|
||||||
// so it's safe to hardcode Cloudflare
|
|
||||||
ApiController.initDnsProviderApiFactory(
|
|
||||||
DnsProviderApiFactorySettings(
|
|
||||||
provider: DnsProvider.cloudflare,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
final APIGenericResult<bool> apiResponse =
|
final APIGenericResult<bool> apiResponse =
|
||||||
await ApiController.currentDnsProviderApiFactory!
|
await ApiController.currentDnsProviderApiFactory!
|
||||||
.getDnsProvider(
|
.getDnsProvider(
|
||||||
|
@ -223,16 +213,16 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setCloudflareKey(final String cloudFlareKey) async {
|
void setDnsApiToken(final String dnsApiToken) async {
|
||||||
if (state is ServerInstallationRecovery) {
|
if (state is ServerInstallationRecovery) {
|
||||||
setAndValidateCloudflareToken(cloudFlareKey);
|
setAndValidateDnsApiToken(dnsApiToken);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await repository.saveCloudFlareKey(cloudFlareKey);
|
await repository.saveDnsProviderKey(dnsApiToken);
|
||||||
|
|
||||||
emit(
|
emit(
|
||||||
(state as ServerInstallationNotFinished)
|
(state as ServerInstallationNotFinished)
|
||||||
.copyWith(cloudFlareKey: cloudFlareKey),
|
.copyWith(dnsApiToken: dnsApiToken),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,7 +283,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
await repository.createServer(
|
await repository.createServer(
|
||||||
state.rootUser!,
|
state.rootUser!,
|
||||||
state.serverDomain!.domainName,
|
state.serverDomain!.domainName,
|
||||||
state.cloudFlareKey!,
|
state.dnsApiToken!,
|
||||||
state.backblazeCredential!,
|
state.backblazeCredential!,
|
||||||
onCancel: onCancel,
|
onCancel: onCancel,
|
||||||
onSuccess: onSuccess,
|
onSuccess: onSuccess,
|
||||||
|
@ -595,7 +585,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case RecoveryStep.cloudflareToken:
|
case RecoveryStep.dnsProviderToken:
|
||||||
repository.deleteServerDetails();
|
repository.deleteServerDetails();
|
||||||
emit(
|
emit(
|
||||||
dataState.copyWith(
|
dataState.copyWith(
|
||||||
|
@ -691,12 +681,12 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
emit(
|
emit(
|
||||||
dataState.copyWith(
|
dataState.copyWith(
|
||||||
serverDetails: serverDetails,
|
serverDetails: serverDetails,
|
||||||
currentStep: RecoveryStep.cloudflareToken,
|
currentStep: RecoveryStep.dnsProviderToken,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setAndValidateCloudflareToken(final String token) async {
|
Future<void> setAndValidateDnsApiToken(final String token) async {
|
||||||
final ServerInstallationRecovery dataState =
|
final ServerInstallationRecovery dataState =
|
||||||
state as ServerInstallationRecovery;
|
state as ServerInstallationRecovery;
|
||||||
final ServerDomain? serverDomain = dataState.serverDomain;
|
final ServerDomain? serverDomain = dataState.serverDomain;
|
||||||
|
@ -714,10 +704,13 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
ServerDomain(
|
ServerDomain(
|
||||||
domainName: serverDomain.domainName,
|
domainName: serverDomain.domainName,
|
||||||
zoneId: zoneId,
|
zoneId: zoneId,
|
||||||
provider: DnsProvider.cloudflare,
|
provider: await ServerApi(
|
||||||
|
customToken: token,
|
||||||
|
isWithToken: true,
|
||||||
|
).getDnsProviderType(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await repository.saveCloudFlareKey(token);
|
await repository.saveDnsProviderKey(token);
|
||||||
emit(
|
emit(
|
||||||
dataState.copyWith(
|
dataState.copyWith(
|
||||||
serverDomain: ServerDomain(
|
serverDomain: ServerDomain(
|
||||||
|
@ -725,7 +718,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
zoneId: zoneId,
|
zoneId: zoneId,
|
||||||
provider: DnsProvider.cloudflare,
|
provider: DnsProvider.cloudflare,
|
||||||
),
|
),
|
||||||
cloudFlareKey: token,
|
dnsApiToken: token,
|
||||||
currentStep: RecoveryStep.backblazeToken,
|
currentStep: RecoveryStep.backblazeToken,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -776,7 +769,7 @@ class ServerInstallationCubit extends Cubit<ServerInstallationState> {
|
||||||
ServerInstallationNotFinished(
|
ServerInstallationNotFinished(
|
||||||
providerApiToken: state.providerApiToken,
|
providerApiToken: state.providerApiToken,
|
||||||
serverDomain: state.serverDomain,
|
serverDomain: state.serverDomain,
|
||||||
cloudFlareKey: state.cloudFlareKey,
|
dnsApiToken: state.dnsApiToken,
|
||||||
backblazeCredential: state.backblazeCredential,
|
backblazeCredential: state.backblazeCredential,
|
||||||
rootUser: state.rootUser,
|
rootUser: state.rootUser,
|
||||||
serverDetails: null,
|
serverDetails: null,
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ServerInstallationRepository {
|
||||||
Future<ServerInstallationState> load() async {
|
Future<ServerInstallationState> load() async {
|
||||||
final String? providerApiToken = getIt<ApiConfigModel>().serverProviderKey;
|
final String? providerApiToken = getIt<ApiConfigModel>().serverProviderKey;
|
||||||
final String? location = getIt<ApiConfigModel>().serverLocation;
|
final String? location = getIt<ApiConfigModel>().serverLocation;
|
||||||
final String? cloudflareToken = getIt<ApiConfigModel>().cloudFlareKey;
|
final String? dnsApiToken = getIt<ApiConfigModel>().dnsProviderKey;
|
||||||
final String? serverTypeIdentificator = getIt<ApiConfigModel>().serverType;
|
final String? serverTypeIdentificator = getIt<ApiConfigModel>().serverType;
|
||||||
final ServerDomain? serverDomain = getIt<ApiConfigModel>().serverDomain;
|
final ServerDomain? serverDomain = getIt<ApiConfigModel>().serverDomain;
|
||||||
final ServerProvider? serverProvider =
|
final ServerProvider? serverProvider =
|
||||||
|
@ -54,6 +54,7 @@ class ServerInstallationRepository {
|
||||||
getIt<ApiConfigModel>().backblazeCredential;
|
getIt<ApiConfigModel>().backblazeCredential;
|
||||||
final ServerHostingDetails? serverDetails =
|
final ServerHostingDetails? serverDetails =
|
||||||
getIt<ApiConfigModel>().serverDetails;
|
getIt<ApiConfigModel>().serverDetails;
|
||||||
|
final DnsProvider? dnsProvider = getIt<ApiConfigModel>().dnsProvider;
|
||||||
|
|
||||||
if (serverProvider != null ||
|
if (serverProvider != null ||
|
||||||
(serverDetails != null &&
|
(serverDetails != null &&
|
||||||
|
@ -75,18 +76,21 @@ class ServerInstallationRepository {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// No other DNS provider is supported for now, so it's fine.
|
if (dnsProvider != null ||
|
||||||
|
(serverDomain != null &&
|
||||||
|
serverDomain.provider != DnsProvider.unknown)) {
|
||||||
ApiController.initDnsProviderApiFactory(
|
ApiController.initDnsProviderApiFactory(
|
||||||
DnsProviderApiFactorySettings(
|
DnsProviderApiFactorySettings(
|
||||||
provider: DnsProvider.cloudflare,
|
provider: dnsProvider ?? serverDomain!.provider,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (box.get(BNames.hasFinalChecked, defaultValue: false)) {
|
if (box.get(BNames.hasFinalChecked, defaultValue: false)) {
|
||||||
return ServerInstallationFinished(
|
return ServerInstallationFinished(
|
||||||
providerApiToken: providerApiToken!,
|
providerApiToken: providerApiToken!,
|
||||||
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
||||||
cloudFlareKey: cloudflareToken!,
|
dnsApiToken: dnsApiToken!,
|
||||||
serverDomain: serverDomain!,
|
serverDomain: serverDomain!,
|
||||||
backblazeCredential: backblazeCredential!,
|
backblazeCredential: backblazeCredential!,
|
||||||
serverDetails: serverDetails!,
|
serverDetails: serverDetails!,
|
||||||
|
@ -103,14 +107,14 @@ class ServerInstallationRepository {
|
||||||
serverDomain != null) {
|
serverDomain != null) {
|
||||||
return ServerInstallationRecovery(
|
return ServerInstallationRecovery(
|
||||||
providerApiToken: providerApiToken,
|
providerApiToken: providerApiToken,
|
||||||
cloudFlareKey: cloudflareToken,
|
dnsApiToken: dnsApiToken,
|
||||||
serverDomain: serverDomain,
|
serverDomain: serverDomain,
|
||||||
backblazeCredential: backblazeCredential,
|
backblazeCredential: backblazeCredential,
|
||||||
serverDetails: serverDetails,
|
serverDetails: serverDetails,
|
||||||
rootUser: box.get(BNames.rootUser),
|
rootUser: box.get(BNames.rootUser),
|
||||||
currentStep: _getCurrentRecoveryStep(
|
currentStep: _getCurrentRecoveryStep(
|
||||||
providerApiToken,
|
providerApiToken,
|
||||||
cloudflareToken,
|
dnsApiToken,
|
||||||
serverDomain,
|
serverDomain,
|
||||||
serverDetails,
|
serverDetails,
|
||||||
),
|
),
|
||||||
|
@ -120,7 +124,7 @@ class ServerInstallationRepository {
|
||||||
|
|
||||||
return ServerInstallationNotFinished(
|
return ServerInstallationNotFinished(
|
||||||
providerApiToken: providerApiToken,
|
providerApiToken: providerApiToken,
|
||||||
cloudFlareKey: cloudflareToken,
|
dnsApiToken: dnsApiToken,
|
||||||
serverDomain: serverDomain,
|
serverDomain: serverDomain,
|
||||||
backblazeCredential: backblazeCredential,
|
backblazeCredential: backblazeCredential,
|
||||||
serverDetails: serverDetails,
|
serverDetails: serverDetails,
|
||||||
|
@ -147,7 +151,7 @@ class ServerInstallationRepository {
|
||||||
if (serverDomain.provider != DnsProvider.unknown) {
|
if (serverDomain.provider != DnsProvider.unknown) {
|
||||||
return RecoveryStep.backblazeToken;
|
return RecoveryStep.backblazeToken;
|
||||||
}
|
}
|
||||||
return RecoveryStep.cloudflareToken;
|
return RecoveryStep.dnsProviderToken;
|
||||||
}
|
}
|
||||||
return RecoveryStep.serverSelection;
|
return RecoveryStep.serverSelection;
|
||||||
}
|
}
|
||||||
|
@ -238,7 +242,7 @@ class ServerInstallationRepository {
|
||||||
Future<void> createServer(
|
Future<void> createServer(
|
||||||
final User rootUser,
|
final User rootUser,
|
||||||
final String domainName,
|
final String domainName,
|
||||||
final String cloudFlareKey,
|
final String dnsApiToken,
|
||||||
final BackblazeCredential backblazeCredential, {
|
final BackblazeCredential backblazeCredential, {
|
||||||
required final void Function() onCancel,
|
required final void Function() onCancel,
|
||||||
required final Future<void> Function(ServerHostingDetails serverDetails)
|
required final Future<void> Function(ServerHostingDetails serverDetails)
|
||||||
|
@ -256,7 +260,8 @@ class ServerInstallationRepository {
|
||||||
ServerHostingDetails? serverDetails;
|
ServerHostingDetails? serverDetails;
|
||||||
try {
|
try {
|
||||||
final APIGenericResult createResult = await api.createServer(
|
final APIGenericResult createResult = await api.createServer(
|
||||||
dnsApiToken: cloudFlareKey,
|
dnsProvider: getIt<ApiConfigModel>().dnsProvider!,
|
||||||
|
dnsApiToken: dnsApiToken,
|
||||||
rootUser: rootUser,
|
rootUser: rootUser,
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
serverType: getIt<ApiConfigModel>().serverType!,
|
serverType: getIt<ApiConfigModel>().serverType!,
|
||||||
|
@ -280,7 +285,8 @@ class ServerInstallationRepository {
|
||||||
try {
|
try {
|
||||||
final APIGenericResult<ServerHostingDetails?> createServerResult =
|
final APIGenericResult<ServerHostingDetails?> createServerResult =
|
||||||
await api.createServer(
|
await api.createServer(
|
||||||
dnsApiToken: cloudFlareKey,
|
dnsProvider: getIt<ApiConfigModel>().dnsProvider!,
|
||||||
|
dnsApiToken: dnsApiToken,
|
||||||
rootUser: rootUser,
|
rootUser: rootUser,
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
serverType: getIt<ApiConfigModel>().serverType!,
|
serverType: getIt<ApiConfigModel>().serverType!,
|
||||||
|
@ -304,7 +310,8 @@ class ServerInstallationRepository {
|
||||||
ServerHostingDetails? serverDetails;
|
ServerHostingDetails? serverDetails;
|
||||||
try {
|
try {
|
||||||
final APIGenericResult createResult = await api.createServer(
|
final APIGenericResult createResult = await api.createServer(
|
||||||
dnsApiToken: cloudFlareKey,
|
dnsProvider: getIt<ApiConfigModel>().dnsProvider!,
|
||||||
|
dnsApiToken: dnsApiToken,
|
||||||
rootUser: rootUser,
|
rootUser: rootUser,
|
||||||
domainName: domainName,
|
domainName: domainName,
|
||||||
serverType: getIt<ApiConfigModel>().serverType!,
|
serverType: getIt<ApiConfigModel>().serverType!,
|
||||||
|
@ -721,11 +728,11 @@ class ServerInstallationRepository {
|
||||||
getIt<ApiConfigModel>().init();
|
getIt<ApiConfigModel>().init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> saveCloudFlareKey(final String key) async {
|
Future<void> saveDnsProviderKey(final String key) async {
|
||||||
await getIt<ApiConfigModel>().storeCloudFlareKey(key);
|
await getIt<ApiConfigModel>().storeDnsProviderKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> deleteCloudFlareKey() async {
|
Future<void> deleteDnsProviderKey() async {
|
||||||
await box.delete(BNames.cloudFlareKey);
|
await box.delete(BNames.cloudFlareKey);
|
||||||
getIt<ApiConfigModel>().init();
|
getIt<ApiConfigModel>().init();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ abstract class ServerInstallationState extends Equatable {
|
||||||
const ServerInstallationState({
|
const ServerInstallationState({
|
||||||
required this.providerApiToken,
|
required this.providerApiToken,
|
||||||
required this.serverTypeIdentificator,
|
required this.serverTypeIdentificator,
|
||||||
required this.cloudFlareKey,
|
required this.dnsApiToken,
|
||||||
required this.backblazeCredential,
|
required this.backblazeCredential,
|
||||||
required this.serverDomain,
|
required this.serverDomain,
|
||||||
required this.rootUser,
|
required this.rootUser,
|
||||||
|
@ -18,7 +18,7 @@ abstract class ServerInstallationState extends Equatable {
|
||||||
List<Object?> get props => [
|
List<Object?> get props => [
|
||||||
providerApiToken,
|
providerApiToken,
|
||||||
serverTypeIdentificator,
|
serverTypeIdentificator,
|
||||||
cloudFlareKey,
|
dnsApiToken,
|
||||||
backblazeCredential,
|
backblazeCredential,
|
||||||
serverDomain,
|
serverDomain,
|
||||||
rootUser,
|
rootUser,
|
||||||
|
@ -28,7 +28,7 @@ abstract class ServerInstallationState extends Equatable {
|
||||||
];
|
];
|
||||||
|
|
||||||
final String? providerApiToken;
|
final String? providerApiToken;
|
||||||
final String? cloudFlareKey;
|
final String? dnsApiToken;
|
||||||
final String? serverTypeIdentificator;
|
final String? serverTypeIdentificator;
|
||||||
final BackblazeCredential? backblazeCredential;
|
final BackblazeCredential? backblazeCredential;
|
||||||
final ServerDomain? serverDomain;
|
final ServerDomain? serverDomain;
|
||||||
|
@ -40,7 +40,7 @@ abstract class ServerInstallationState extends Equatable {
|
||||||
|
|
||||||
bool get isServerProviderApiKeyFilled => providerApiToken != null;
|
bool get isServerProviderApiKeyFilled => providerApiToken != null;
|
||||||
bool get isServerTypeFilled => serverTypeIdentificator != null;
|
bool get isServerTypeFilled => serverTypeIdentificator != null;
|
||||||
bool get isDnsProviderFilled => cloudFlareKey != null;
|
bool get isDnsProviderFilled => dnsApiToken != null;
|
||||||
bool get isBackupsProviderFilled => backblazeCredential != null;
|
bool get isBackupsProviderFilled => backblazeCredential != null;
|
||||||
bool get isDomainSelected => serverDomain != null;
|
bool get isDomainSelected => serverDomain != null;
|
||||||
bool get isPrimaryUserFilled => rootUser != null;
|
bool get isPrimaryUserFilled => rootUser != null;
|
||||||
|
@ -87,7 +87,7 @@ class TimerState extends ServerInstallationNotFinished {
|
||||||
}) : super(
|
}) : super(
|
||||||
providerApiToken: dataState.providerApiToken,
|
providerApiToken: dataState.providerApiToken,
|
||||||
serverTypeIdentificator: dataState.serverTypeIdentificator,
|
serverTypeIdentificator: dataState.serverTypeIdentificator,
|
||||||
cloudFlareKey: dataState.cloudFlareKey,
|
dnsApiToken: dataState.dnsApiToken,
|
||||||
backblazeCredential: dataState.backblazeCredential,
|
backblazeCredential: dataState.backblazeCredential,
|
||||||
serverDomain: dataState.serverDomain,
|
serverDomain: dataState.serverDomain,
|
||||||
rootUser: dataState.rootUser,
|
rootUser: dataState.rootUser,
|
||||||
|
@ -114,7 +114,7 @@ enum ServerSetupProgress {
|
||||||
nothingYet,
|
nothingYet,
|
||||||
serverProviderFilled,
|
serverProviderFilled,
|
||||||
servertTypeFilled,
|
servertTypeFilled,
|
||||||
cloudFlareFilled,
|
dnsProviderFilled,
|
||||||
backblazeFilled,
|
backblazeFilled,
|
||||||
domainFilled,
|
domainFilled,
|
||||||
userFilled,
|
userFilled,
|
||||||
|
@ -133,7 +133,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
||||||
required this.dnsMatches,
|
required this.dnsMatches,
|
||||||
super.providerApiToken,
|
super.providerApiToken,
|
||||||
super.serverTypeIdentificator,
|
super.serverTypeIdentificator,
|
||||||
super.cloudFlareKey,
|
super.dnsApiToken,
|
||||||
super.backblazeCredential,
|
super.backblazeCredential,
|
||||||
super.serverDomain,
|
super.serverDomain,
|
||||||
super.rootUser,
|
super.rootUser,
|
||||||
|
@ -146,7 +146,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
||||||
List<Object?> get props => [
|
List<Object?> get props => [
|
||||||
providerApiToken,
|
providerApiToken,
|
||||||
serverTypeIdentificator,
|
serverTypeIdentificator,
|
||||||
cloudFlareKey,
|
dnsApiToken,
|
||||||
backblazeCredential,
|
backblazeCredential,
|
||||||
serverDomain,
|
serverDomain,
|
||||||
rootUser,
|
rootUser,
|
||||||
|
@ -160,7 +160,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
||||||
ServerInstallationNotFinished copyWith({
|
ServerInstallationNotFinished copyWith({
|
||||||
final String? providerApiToken,
|
final String? providerApiToken,
|
||||||
final String? serverTypeIdentificator,
|
final String? serverTypeIdentificator,
|
||||||
final String? cloudFlareKey,
|
final String? dnsApiToken,
|
||||||
final BackblazeCredential? backblazeCredential,
|
final BackblazeCredential? backblazeCredential,
|
||||||
final ServerDomain? serverDomain,
|
final ServerDomain? serverDomain,
|
||||||
final User? rootUser,
|
final User? rootUser,
|
||||||
|
@ -175,7 +175,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
||||||
providerApiToken: providerApiToken ?? this.providerApiToken,
|
providerApiToken: providerApiToken ?? this.providerApiToken,
|
||||||
serverTypeIdentificator:
|
serverTypeIdentificator:
|
||||||
serverTypeIdentificator ?? this.serverTypeIdentificator,
|
serverTypeIdentificator ?? this.serverTypeIdentificator,
|
||||||
cloudFlareKey: cloudFlareKey ?? this.cloudFlareKey,
|
dnsApiToken: dnsApiToken ?? this.dnsApiToken,
|
||||||
backblazeCredential: backblazeCredential ?? this.backblazeCredential,
|
backblazeCredential: backblazeCredential ?? this.backblazeCredential,
|
||||||
serverDomain: serverDomain ?? this.serverDomain,
|
serverDomain: serverDomain ?? this.serverDomain,
|
||||||
rootUser: rootUser ?? this.rootUser,
|
rootUser: rootUser ?? this.rootUser,
|
||||||
|
@ -192,7 +192,7 @@ class ServerInstallationNotFinished extends ServerInstallationState {
|
||||||
ServerInstallationFinished finish() => ServerInstallationFinished(
|
ServerInstallationFinished finish() => ServerInstallationFinished(
|
||||||
providerApiToken: providerApiToken!,
|
providerApiToken: providerApiToken!,
|
||||||
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
||||||
cloudFlareKey: cloudFlareKey!,
|
dnsApiToken: dnsApiToken!,
|
||||||
backblazeCredential: backblazeCredential!,
|
backblazeCredential: backblazeCredential!,
|
||||||
serverDomain: serverDomain!,
|
serverDomain: serverDomain!,
|
||||||
rootUser: rootUser!,
|
rootUser: rootUser!,
|
||||||
|
@ -208,7 +208,7 @@ class ServerInstallationEmpty extends ServerInstallationNotFinished {
|
||||||
: super(
|
: super(
|
||||||
providerApiToken: null,
|
providerApiToken: null,
|
||||||
serverTypeIdentificator: null,
|
serverTypeIdentificator: null,
|
||||||
cloudFlareKey: null,
|
dnsApiToken: null,
|
||||||
backblazeCredential: null,
|
backblazeCredential: null,
|
||||||
serverDomain: null,
|
serverDomain: null,
|
||||||
rootUser: null,
|
rootUser: null,
|
||||||
|
@ -225,7 +225,7 @@ class ServerInstallationFinished extends ServerInstallationState {
|
||||||
const ServerInstallationFinished({
|
const ServerInstallationFinished({
|
||||||
required String super.providerApiToken,
|
required String super.providerApiToken,
|
||||||
required String super.serverTypeIdentificator,
|
required String super.serverTypeIdentificator,
|
||||||
required String super.cloudFlareKey,
|
required String super.dnsApiToken,
|
||||||
required BackblazeCredential super.backblazeCredential,
|
required BackblazeCredential super.backblazeCredential,
|
||||||
required ServerDomain super.serverDomain,
|
required ServerDomain super.serverDomain,
|
||||||
required User super.rootUser,
|
required User super.rootUser,
|
||||||
|
@ -239,7 +239,7 @@ class ServerInstallationFinished extends ServerInstallationState {
|
||||||
List<Object?> get props => [
|
List<Object?> get props => [
|
||||||
providerApiToken,
|
providerApiToken,
|
||||||
serverTypeIdentificator,
|
serverTypeIdentificator,
|
||||||
cloudFlareKey,
|
dnsApiToken,
|
||||||
backblazeCredential,
|
backblazeCredential,
|
||||||
serverDomain,
|
serverDomain,
|
||||||
rootUser,
|
rootUser,
|
||||||
|
@ -256,7 +256,7 @@ enum RecoveryStep {
|
||||||
oldToken,
|
oldToken,
|
||||||
serverProviderToken,
|
serverProviderToken,
|
||||||
serverSelection,
|
serverSelection,
|
||||||
cloudflareToken,
|
dnsProviderToken,
|
||||||
backblazeToken,
|
backblazeToken,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
||||||
required this.recoveryCapabilities,
|
required this.recoveryCapabilities,
|
||||||
super.providerApiToken,
|
super.providerApiToken,
|
||||||
super.serverTypeIdentificator,
|
super.serverTypeIdentificator,
|
||||||
super.cloudFlareKey,
|
super.dnsApiToken,
|
||||||
super.backblazeCredential,
|
super.backblazeCredential,
|
||||||
super.serverDomain,
|
super.serverDomain,
|
||||||
super.rootUser,
|
super.rootUser,
|
||||||
|
@ -295,7 +295,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
||||||
List<Object?> get props => [
|
List<Object?> get props => [
|
||||||
providerApiToken,
|
providerApiToken,
|
||||||
serverTypeIdentificator,
|
serverTypeIdentificator,
|
||||||
cloudFlareKey,
|
dnsApiToken,
|
||||||
backblazeCredential,
|
backblazeCredential,
|
||||||
serverDomain,
|
serverDomain,
|
||||||
rootUser,
|
rootUser,
|
||||||
|
@ -308,7 +308,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
||||||
ServerInstallationRecovery copyWith({
|
ServerInstallationRecovery copyWith({
|
||||||
final String? providerApiToken,
|
final String? providerApiToken,
|
||||||
final String? serverTypeIdentificator,
|
final String? serverTypeIdentificator,
|
||||||
final String? cloudFlareKey,
|
final String? dnsApiToken,
|
||||||
final BackblazeCredential? backblazeCredential,
|
final BackblazeCredential? backblazeCredential,
|
||||||
final ServerDomain? serverDomain,
|
final ServerDomain? serverDomain,
|
||||||
final User? rootUser,
|
final User? rootUser,
|
||||||
|
@ -320,7 +320,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
||||||
providerApiToken: providerApiToken ?? this.providerApiToken,
|
providerApiToken: providerApiToken ?? this.providerApiToken,
|
||||||
serverTypeIdentificator:
|
serverTypeIdentificator:
|
||||||
serverTypeIdentificator ?? this.serverTypeIdentificator,
|
serverTypeIdentificator ?? this.serverTypeIdentificator,
|
||||||
cloudFlareKey: cloudFlareKey ?? this.cloudFlareKey,
|
dnsApiToken: dnsApiToken ?? this.dnsApiToken,
|
||||||
backblazeCredential: backblazeCredential ?? this.backblazeCredential,
|
backblazeCredential: backblazeCredential ?? this.backblazeCredential,
|
||||||
serverDomain: serverDomain ?? this.serverDomain,
|
serverDomain: serverDomain ?? this.serverDomain,
|
||||||
rootUser: rootUser ?? this.rootUser,
|
rootUser: rootUser ?? this.rootUser,
|
||||||
|
@ -332,7 +332,7 @@ class ServerInstallationRecovery extends ServerInstallationState {
|
||||||
ServerInstallationFinished finish() => ServerInstallationFinished(
|
ServerInstallationFinished finish() => ServerInstallationFinished(
|
||||||
providerApiToken: providerApiToken!,
|
providerApiToken: providerApiToken!,
|
||||||
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
serverTypeIdentificator: serverTypeIdentificator ?? '',
|
||||||
cloudFlareKey: cloudFlareKey!,
|
dnsApiToken: dnsApiToken!,
|
||||||
backblazeCredential: backblazeCredential!,
|
backblazeCredential: backblazeCredential!,
|
||||||
serverDomain: serverDomain!,
|
serverDomain: serverDomain!,
|
||||||
rootUser: rootUser!,
|
rootUser: rootUser!,
|
||||||
|
|
|
@ -12,7 +12,7 @@ class ApiConfigModel {
|
||||||
String? get serverProviderKey => _serverProviderKey;
|
String? get serverProviderKey => _serverProviderKey;
|
||||||
String? get serverLocation => _serverLocation;
|
String? get serverLocation => _serverLocation;
|
||||||
String? get serverType => _serverType;
|
String? get serverType => _serverType;
|
||||||
String? get cloudFlareKey => _cloudFlareKey;
|
String? get dnsProviderKey => _dnsProviderKey;
|
||||||
ServerProvider? get serverProvider => _serverProvider;
|
ServerProvider? get serverProvider => _serverProvider;
|
||||||
DnsProvider? get dnsProvider => _dnsProvider;
|
DnsProvider? get dnsProvider => _dnsProvider;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class ApiConfigModel {
|
||||||
|
|
||||||
String? _serverProviderKey;
|
String? _serverProviderKey;
|
||||||
String? _serverLocation;
|
String? _serverLocation;
|
||||||
String? _cloudFlareKey;
|
String? _dnsProviderKey;
|
||||||
String? _serverType;
|
String? _serverType;
|
||||||
ServerProvider? _serverProvider;
|
ServerProvider? _serverProvider;
|
||||||
DnsProvider? _dnsProvider;
|
DnsProvider? _dnsProvider;
|
||||||
|
@ -46,9 +46,9 @@ class ApiConfigModel {
|
||||||
_serverProviderKey = value;
|
_serverProviderKey = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> storeCloudFlareKey(final String value) async {
|
Future<void> storeDnsProviderKey(final String value) async {
|
||||||
await _box.put(BNames.cloudFlareKey, value);
|
await _box.put(BNames.cloudFlareKey, value);
|
||||||
_cloudFlareKey = value;
|
_dnsProviderKey = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> storeServerTypeIdentifier(final String typeIdentifier) async {
|
Future<void> storeServerTypeIdentifier(final String typeIdentifier) async {
|
||||||
|
@ -85,7 +85,7 @@ class ApiConfigModel {
|
||||||
_serverProviderKey = null;
|
_serverProviderKey = null;
|
||||||
_dnsProvider = null;
|
_dnsProvider = null;
|
||||||
_serverLocation = null;
|
_serverLocation = null;
|
||||||
_cloudFlareKey = null;
|
_dnsProviderKey = null;
|
||||||
_backblazeCredential = null;
|
_backblazeCredential = null;
|
||||||
_serverDomain = null;
|
_serverDomain = null;
|
||||||
_serverDetails = null;
|
_serverDetails = null;
|
||||||
|
@ -97,7 +97,7 @@ class ApiConfigModel {
|
||||||
void init() {
|
void init() {
|
||||||
_serverProviderKey = _box.get(BNames.hetznerKey);
|
_serverProviderKey = _box.get(BNames.hetznerKey);
|
||||||
_serverLocation = _box.get(BNames.serverLocation);
|
_serverLocation = _box.get(BNames.serverLocation);
|
||||||
_cloudFlareKey = _box.get(BNames.cloudFlareKey);
|
_dnsProviderKey = _box.get(BNames.cloudFlareKey);
|
||||||
_backblazeCredential = _box.get(BNames.backblazeCredential);
|
_backblazeCredential = _box.get(BNames.backblazeCredential);
|
||||||
_serverDomain = _box.get(BNames.serverDomain);
|
_serverDomain = _box.get(BNames.serverDomain);
|
||||||
_serverDetails = _box.get(BNames.serverDetails);
|
_serverDetails = _box.get(BNames.serverDetails);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:selfprivacy/logic/api_maps/graphql_maps/schema/schema.graphql.dart';
|
||||||
|
|
||||||
part 'server_domain.g.dart';
|
part 'server_domain.g.dart';
|
||||||
|
|
||||||
|
@ -30,5 +31,16 @@ enum DnsProvider {
|
||||||
@HiveField(1)
|
@HiveField(1)
|
||||||
cloudflare,
|
cloudflare,
|
||||||
@HiveField(2)
|
@HiveField(2)
|
||||||
desec
|
desec;
|
||||||
|
|
||||||
|
factory DnsProvider.fromGraphQL(final Enum$DnsProvider provider) {
|
||||||
|
switch (provider) {
|
||||||
|
case Enum$DnsProvider.CLOUDFLARE:
|
||||||
|
return cloudflare;
|
||||||
|
case Enum$DnsProvider.DESEC:
|
||||||
|
return desec;
|
||||||
|
default:
|
||||||
|
return unknown;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,8 @@ class DnsProviderAdapter extends TypeAdapter<DnsProvider> {
|
||||||
return DnsProvider.unknown;
|
return DnsProvider.unknown;
|
||||||
case 1:
|
case 1:
|
||||||
return DnsProvider.cloudflare;
|
return DnsProvider.cloudflare;
|
||||||
|
case 2:
|
||||||
|
return DnsProvider.desec;
|
||||||
default:
|
default:
|
||||||
return DnsProvider.unknown;
|
return DnsProvider.unknown;
|
||||||
}
|
}
|
||||||
|
@ -72,6 +74,9 @@ class DnsProviderAdapter extends TypeAdapter<DnsProvider> {
|
||||||
case DnsProvider.cloudflare:
|
case DnsProvider.cloudflare:
|
||||||
writer.writeByte(1);
|
writer.writeByte(1);
|
||||||
break;
|
break;
|
||||||
|
case DnsProvider.desec:
|
||||||
|
writer.writeByte(2);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ import 'package:selfprivacy/logic/cubit/support_system/support_system_cubit.dart
|
||||||
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
import 'package:selfprivacy/ui/components/buttons/brand_button.dart';
|
||||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||||
|
|
||||||
class RecoveryConfirmCloudflare extends StatelessWidget {
|
class RecoveryConfirmDns extends StatelessWidget {
|
||||||
const RecoveryConfirmCloudflare({super.key});
|
const RecoveryConfirmDns({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(final BuildContext context) {
|
Widget build(final BuildContext context) {
|
|
@ -12,7 +12,7 @@ import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_old_token.dart'
|
||||||
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_recovery_key.dart';
|
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_recovery_key.dart';
|
||||||
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_new_device_key.dart';
|
import 'package:selfprivacy/ui/pages/setup/recovering/recover_by_new_device_key.dart';
|
||||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_backblaze.dart';
|
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_backblaze.dart';
|
||||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_cloudflare.dart';
|
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_dns.dart';
|
||||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_server.dart';
|
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_confirm_server.dart';
|
||||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_server_provider_connected.dart';
|
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_server_provider_connected.dart';
|
||||||
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_method_select.dart';
|
import 'package:selfprivacy/ui/pages/setup/recovering/recovery_method_select.dart';
|
||||||
|
@ -55,8 +55,8 @@ class RecoveryRouting extends StatelessWidget {
|
||||||
case RecoveryStep.serverSelection:
|
case RecoveryStep.serverSelection:
|
||||||
currentPage = const RecoveryConfirmServer();
|
currentPage = const RecoveryConfirmServer();
|
||||||
break;
|
break;
|
||||||
case RecoveryStep.cloudflareToken:
|
case RecoveryStep.dnsProviderToken:
|
||||||
currentPage = const RecoveryConfirmCloudflare();
|
currentPage = const RecoveryConfirmDns();
|
||||||
break;
|
break;
|
||||||
case RecoveryStep.backblazeToken:
|
case RecoveryStep.backblazeToken:
|
||||||
currentPage = const RecoveryConfirmBackblaze();
|
currentPage = const RecoveryConfirmBackblaze();
|
||||||
|
|
|
@ -14,52 +14,16 @@ abstract class _$RootRouter extends RootStackRouter {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final Map<String, PageFactory> pagesMap = {
|
final Map<String, PageFactory> pagesMap = {
|
||||||
AboutApplicationRoute.name: (routeData) {
|
BackupDetailsRoute.name: (routeData) {
|
||||||
return AutoRoutePage<dynamic>(
|
return AutoRoutePage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const AboutApplicationPage(),
|
child: const BackupDetailsPage(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
AppSettingsRoute.name: (routeData) {
|
RootRoute.name: (routeData) {
|
||||||
return AutoRoutePage<dynamic>(
|
return AutoRoutePage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const AppSettingsPage(),
|
child: WrappedRoute(child: const RootPage()),
|
||||||
);
|
|
||||||
},
|
|
||||||
DeveloperSettingsRoute.name: (routeData) {
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: const DeveloperSettingsPage(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
ConsoleRoute.name: (routeData) {
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: const ConsolePage(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
MoreRoute.name: (routeData) {
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: const MorePage(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
OnboardingRoute.name: (routeData) {
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: const OnboardingPage(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
ProvidersRoute.name: (routeData) {
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: const ProvidersPage(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
ServerDetailsRoute.name: (routeData) {
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: const ServerDetailsScreen(),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
ServiceRoute.name: (routeData) {
|
ServiceRoute.name: (routeData) {
|
||||||
|
@ -78,6 +42,12 @@ abstract class _$RootRouter extends RootStackRouter {
|
||||||
child: const ServicesPage(),
|
child: const ServicesPage(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
ServerDetailsRoute.name: (routeData) {
|
||||||
|
return AutoRoutePage<dynamic>(
|
||||||
|
routeData: routeData,
|
||||||
|
child: const ServerDetailsScreen(),
|
||||||
|
);
|
||||||
|
},
|
||||||
UsersRoute.name: (routeData) {
|
UsersRoute.name: (routeData) {
|
||||||
return AutoRoutePage<dynamic>(
|
return AutoRoutePage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
|
@ -100,10 +70,46 @@ abstract class _$RootRouter extends RootStackRouter {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
BackupDetailsRoute.name: (routeData) {
|
AppSettingsRoute.name: (routeData) {
|
||||||
return AutoRoutePage<dynamic>(
|
return AutoRoutePage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const BackupDetailsPage(),
|
child: const AppSettingsPage(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
DeveloperSettingsRoute.name: (routeData) {
|
||||||
|
return AutoRoutePage<dynamic>(
|
||||||
|
routeData: routeData,
|
||||||
|
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) {
|
DnsDetailsRoute.name: (routeData) {
|
||||||
|
@ -124,26 +130,12 @@ abstract class _$RootRouter extends RootStackRouter {
|
||||||
child: const InitializingPage(),
|
child: const InitializingPage(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
RecoveryKeyRoute.name: (routeData) {
|
ServerStorageRoute.name: (routeData) {
|
||||||
|
final args = routeData.argsAs<ServerStorageRouteArgs>();
|
||||||
return AutoRoutePage<dynamic>(
|
return AutoRoutePage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: const RecoveryKeyPage(),
|
child: ServerStoragePage(
|
||||||
);
|
|
||||||
},
|
|
||||||
DevicesRoute.name: (routeData) {
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: const DevicesScreen(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
ServicesMigrationRoute.name: (routeData) {
|
|
||||||
final args = routeData.argsAs<ServicesMigrationRouteArgs>();
|
|
||||||
return AutoRoutePage<dynamic>(
|
|
||||||
routeData: routeData,
|
|
||||||
child: ServicesMigrationPage(
|
|
||||||
services: args.services,
|
|
||||||
diskStatus: args.diskStatus,
|
diskStatus: args.diskStatus,
|
||||||
isMigration: args.isMigration,
|
|
||||||
key: args.key,
|
key: args.key,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -159,133 +151,57 @@ abstract class _$RootRouter extends RootStackRouter {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
ServerStorageRoute.name: (routeData) {
|
ServicesMigrationRoute.name: (routeData) {
|
||||||
final args = routeData.argsAs<ServerStorageRouteArgs>();
|
final args = routeData.argsAs<ServicesMigrationRouteArgs>();
|
||||||
return AutoRoutePage<dynamic>(
|
return AutoRoutePage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: ServerStoragePage(
|
child: ServicesMigrationPage(
|
||||||
|
services: args.services,
|
||||||
diskStatus: args.diskStatus,
|
diskStatus: args.diskStatus,
|
||||||
|
isMigration: args.isMigration,
|
||||||
key: args.key,
|
key: args.key,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
RootRoute.name: (routeData) {
|
DevicesRoute.name: (routeData) {
|
||||||
return AutoRoutePage<dynamic>(
|
return AutoRoutePage<dynamic>(
|
||||||
routeData: routeData,
|
routeData: routeData,
|
||||||
child: WrappedRoute(child: const RootPage()),
|
child: const DevicesScreen(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
OnboardingRoute.name: (routeData) {
|
||||||
|
return AutoRoutePage<dynamic>(
|
||||||
|
routeData: routeData,
|
||||||
|
child: const OnboardingPage(),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [AboutApplicationPage]
|
/// [BackupDetailsPage]
|
||||||
class AboutApplicationRoute extends PageRouteInfo<void> {
|
class BackupDetailsRoute extends PageRouteInfo<void> {
|
||||||
const AboutApplicationRoute({List<PageRouteInfo>? children})
|
const BackupDetailsRoute({List<PageRouteInfo>? children})
|
||||||
: super(
|
: super(
|
||||||
AboutApplicationRoute.name,
|
BackupDetailsRoute.name,
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AboutApplicationRoute';
|
static const String name = 'BackupDetailsRoute';
|
||||||
|
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [AppSettingsPage]
|
/// [RootPage]
|
||||||
class AppSettingsRoute extends PageRouteInfo<void> {
|
class RootRoute extends PageRouteInfo<void> {
|
||||||
const AppSettingsRoute({List<PageRouteInfo>? children})
|
const RootRoute({List<PageRouteInfo>? children})
|
||||||
: super(
|
: super(
|
||||||
AppSettingsRoute.name,
|
RootRoute.name,
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'AppSettingsRoute';
|
static const String name = 'RootRoute';
|
||||||
|
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [DeveloperSettingsPage]
|
|
||||||
class DeveloperSettingsRoute extends PageRouteInfo<void> {
|
|
||||||
const DeveloperSettingsRoute({List<PageRouteInfo>? children})
|
|
||||||
: super(
|
|
||||||
DeveloperSettingsRoute.name,
|
|
||||||
initialChildren: children,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const String name = 'DeveloperSettingsRoute';
|
|
||||||
|
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [ConsolePage]
|
|
||||||
class ConsoleRoute extends PageRouteInfo<void> {
|
|
||||||
const ConsoleRoute({List<PageRouteInfo>? children})
|
|
||||||
: super(
|
|
||||||
ConsoleRoute.name,
|
|
||||||
initialChildren: children,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const String name = 'ConsoleRoute';
|
|
||||||
|
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [MorePage]
|
|
||||||
class MoreRoute extends PageRouteInfo<void> {
|
|
||||||
const MoreRoute({List<PageRouteInfo>? children})
|
|
||||||
: super(
|
|
||||||
MoreRoute.name,
|
|
||||||
initialChildren: children,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const String name = 'MoreRoute';
|
|
||||||
|
|
||||||
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> {
|
|
||||||
const ProvidersRoute({List<PageRouteInfo>? children})
|
|
||||||
: super(
|
|
||||||
ProvidersRoute.name,
|
|
||||||
initialChildren: children,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const String name = 'ProvidersRoute';
|
|
||||||
|
|
||||||
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);
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
}
|
}
|
||||||
|
@ -342,6 +258,20 @@ class ServicesRoute extends PageRouteInfo<void> {
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
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
|
/// generated route for
|
||||||
/// [UsersPage]
|
/// [UsersPage]
|
||||||
class UsersRoute extends PageRouteInfo<void> {
|
class UsersRoute extends PageRouteInfo<void> {
|
||||||
|
@ -409,15 +339,99 @@ class UserDetailsRouteArgs {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [BackupDetailsPage]
|
/// [AppSettingsPage]
|
||||||
class BackupDetailsRoute extends PageRouteInfo<void> {
|
class AppSettingsRoute extends PageRouteInfo<void> {
|
||||||
const BackupDetailsRoute({List<PageRouteInfo>? children})
|
const AppSettingsRoute({List<PageRouteInfo>? children})
|
||||||
: super(
|
: super(
|
||||||
BackupDetailsRoute.name,
|
AppSettingsRoute.name,
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'BackupDetailsRoute';
|
static const String name = 'AppSettingsRoute';
|
||||||
|
|
||||||
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// generated route for
|
||||||
|
/// [DeveloperSettingsPage]
|
||||||
|
class DeveloperSettingsRoute extends PageRouteInfo<void> {
|
||||||
|
const DeveloperSettingsRoute({List<PageRouteInfo>? children})
|
||||||
|
: super(
|
||||||
|
DeveloperSettingsRoute.name,
|
||||||
|
initialChildren: children,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const String name = 'DeveloperSettingsRoute';
|
||||||
|
|
||||||
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// generated route for
|
||||||
|
/// [MorePage]
|
||||||
|
class MoreRoute extends PageRouteInfo<void> {
|
||||||
|
const MoreRoute({List<PageRouteInfo>? children})
|
||||||
|
: super(
|
||||||
|
MoreRoute.name,
|
||||||
|
initialChildren: children,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const String name = 'MoreRoute';
|
||||||
|
|
||||||
|
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> {
|
||||||
|
const ConsoleRoute({List<PageRouteInfo>? children})
|
||||||
|
: super(
|
||||||
|
ConsoleRoute.name,
|
||||||
|
initialChildren: children,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const String name = 'ConsoleRoute';
|
||||||
|
|
||||||
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// generated route for
|
||||||
|
/// [ProvidersPage]
|
||||||
|
class ProvidersRoute extends PageRouteInfo<void> {
|
||||||
|
const ProvidersRoute({List<PageRouteInfo>? children})
|
||||||
|
: super(
|
||||||
|
ProvidersRoute.name,
|
||||||
|
initialChildren: children,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const String name = 'ProvidersRoute';
|
||||||
|
|
||||||
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// generated route for
|
||||||
|
/// [RecoveryKeyPage]
|
||||||
|
class RecoveryKeyRoute extends PageRouteInfo<void> {
|
||||||
|
const RecoveryKeyRoute({List<PageRouteInfo>? children})
|
||||||
|
: super(
|
||||||
|
RecoveryKeyRoute.name,
|
||||||
|
initialChildren: children,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const String name = 'RecoveryKeyRoute';
|
||||||
|
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
}
|
}
|
||||||
|
@ -465,31 +479,84 @@ class InitializingRoute extends PageRouteInfo<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [RecoveryKeyPage]
|
/// [ServerStoragePage]
|
||||||
class RecoveryKeyRoute extends PageRouteInfo<void> {
|
class ServerStorageRoute extends PageRouteInfo<ServerStorageRouteArgs> {
|
||||||
const RecoveryKeyRoute({List<PageRouteInfo>? children})
|
ServerStorageRoute({
|
||||||
: super(
|
required DiskStatus diskStatus,
|
||||||
RecoveryKeyRoute.name,
|
Key? key,
|
||||||
|
List<PageRouteInfo>? children,
|
||||||
|
}) : super(
|
||||||
|
ServerStorageRoute.name,
|
||||||
|
args: ServerStorageRouteArgs(
|
||||||
|
diskStatus: diskStatus,
|
||||||
|
key: key,
|
||||||
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'RecoveryKeyRoute';
|
static const String name = 'ServerStorageRoute';
|
||||||
|
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
static const PageInfo<ServerStorageRouteArgs> page =
|
||||||
|
PageInfo<ServerStorageRouteArgs>(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
|
/// generated route for
|
||||||
/// [DevicesScreen]
|
/// [ExtendingVolumePage]
|
||||||
class DevicesRoute extends PageRouteInfo<void> {
|
class ExtendingVolumeRoute extends PageRouteInfo<ExtendingVolumeRouteArgs> {
|
||||||
const DevicesRoute({List<PageRouteInfo>? children})
|
ExtendingVolumeRoute({
|
||||||
: super(
|
required DiskVolume diskVolumeToResize,
|
||||||
DevicesRoute.name,
|
required DiskStatus diskStatus,
|
||||||
|
Key? key,
|
||||||
|
List<PageRouteInfo>? children,
|
||||||
|
}) : super(
|
||||||
|
ExtendingVolumeRoute.name,
|
||||||
|
args: ExtendingVolumeRouteArgs(
|
||||||
|
diskVolumeToResize: diskVolumeToResize,
|
||||||
|
diskStatus: diskStatus,
|
||||||
|
key: key,
|
||||||
|
),
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'DevicesRoute';
|
static const String name = 'ExtendingVolumeRoute';
|
||||||
|
|
||||||
static const PageInfo<void> page = PageInfo<void>(name);
|
static const PageInfo<ExtendingVolumeRouteArgs> page =
|
||||||
|
PageInfo<ExtendingVolumeRouteArgs>(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
class ExtendingVolumeRouteArgs {
|
||||||
|
const ExtendingVolumeRouteArgs({
|
||||||
|
required this.diskVolumeToResize,
|
||||||
|
required this.diskStatus,
|
||||||
|
this.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
final DiskVolume diskVolumeToResize;
|
||||||
|
|
||||||
|
final DiskStatus diskStatus;
|
||||||
|
|
||||||
|
final Key? key;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'ExtendingVolumeRouteArgs{diskVolumeToResize: $diskVolumeToResize, diskStatus: $diskStatus, key: $key}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
|
@ -541,96 +608,29 @@ class ServicesMigrationRouteArgs {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// generated route for
|
/// generated route for
|
||||||
/// [ExtendingVolumePage]
|
/// [DevicesScreen]
|
||||||
class ExtendingVolumeRoute extends PageRouteInfo<ExtendingVolumeRouteArgs> {
|
class DevicesRoute extends PageRouteInfo<void> {
|
||||||
ExtendingVolumeRoute({
|
const DevicesRoute({List<PageRouteInfo>? children})
|
||||||
required DiskVolume diskVolumeToResize,
|
|
||||||
required DiskStatus diskStatus,
|
|
||||||
Key? key,
|
|
||||||
List<PageRouteInfo>? children,
|
|
||||||
}) : super(
|
|
||||||
ExtendingVolumeRoute.name,
|
|
||||||
args: ExtendingVolumeRouteArgs(
|
|
||||||
diskVolumeToResize: diskVolumeToResize,
|
|
||||||
diskStatus: diskStatus,
|
|
||||||
key: key,
|
|
||||||
),
|
|
||||||
initialChildren: children,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const String name = 'ExtendingVolumeRoute';
|
|
||||||
|
|
||||||
static const PageInfo<ExtendingVolumeRouteArgs> page =
|
|
||||||
PageInfo<ExtendingVolumeRouteArgs>(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
class ExtendingVolumeRouteArgs {
|
|
||||||
const ExtendingVolumeRouteArgs({
|
|
||||||
required this.diskVolumeToResize,
|
|
||||||
required this.diskStatus,
|
|
||||||
this.key,
|
|
||||||
});
|
|
||||||
|
|
||||||
final DiskVolume diskVolumeToResize;
|
|
||||||
|
|
||||||
final DiskStatus diskStatus;
|
|
||||||
|
|
||||||
final Key? key;
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return 'ExtendingVolumeRouteArgs{diskVolumeToResize: $diskVolumeToResize, diskStatus: $diskStatus, key: $key}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// generated route for
|
|
||||||
/// [ServerStoragePage]
|
|
||||||
class ServerStorageRoute extends PageRouteInfo<ServerStorageRouteArgs> {
|
|
||||||
ServerStorageRoute({
|
|
||||||
required DiskStatus diskStatus,
|
|
||||||
Key? key,
|
|
||||||
List<PageRouteInfo>? children,
|
|
||||||
}) : super(
|
|
||||||
ServerStorageRoute.name,
|
|
||||||
args: ServerStorageRouteArgs(
|
|
||||||
diskStatus: diskStatus,
|
|
||||||
key: key,
|
|
||||||
),
|
|
||||||
initialChildren: children,
|
|
||||||
);
|
|
||||||
|
|
||||||
static const String name = 'ServerStorageRoute';
|
|
||||||
|
|
||||||
static const PageInfo<ServerStorageRouteArgs> page =
|
|
||||||
PageInfo<ServerStorageRouteArgs>(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
|
|
||||||
/// [RootPage]
|
|
||||||
class RootRoute extends PageRouteInfo<void> {
|
|
||||||
const RootRoute({List<PageRouteInfo>? children})
|
|
||||||
: super(
|
: super(
|
||||||
RootRoute.name,
|
DevicesRoute.name,
|
||||||
initialChildren: children,
|
initialChildren: children,
|
||||||
);
|
);
|
||||||
|
|
||||||
static const String name = 'RootRoute';
|
static const String name = 'DevicesRoute';
|
||||||
|
|
||||||
|
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);
|
static const PageInfo<void> page = PageInfo<void>(name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue