Compare commits
No commits in common. "master" and "0.11.0" have entirely different histories.
|
@ -40,9 +40,3 @@ app.*.symbols
|
|||
|
||||
# Obfuscation related
|
||||
app.*.map.json
|
||||
|
||||
# Flatpak
|
||||
.flatpak-builder/
|
||||
flatpak-build/
|
||||
flatpak-repo/
|
||||
*.flatpak
|
||||
|
|
|
@ -52,8 +52,8 @@ android {
|
|||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "org.selfprivacy.app"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 34
|
||||
compileSdkVersion 34
|
||||
targetSdkVersion 33
|
||||
compileSdkVersion 33
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -1,7 +1,19 @@
|
|||
[Login as root user to your server](https://selfprivacy.org/docs/how-to-guides/root_ssh/) and enter this command:
|
||||
Login as root user to your server and look at the contents of the file `/etc/nixos/userdata/tokens.json`
|
||||
|
||||
```sh
|
||||
sp-print-api-token
|
||||
cat /etc/nixos/userdata/tokens.json
|
||||
```
|
||||
|
||||
Copy the token from the terminal and paste it in the next window.
|
||||
This file will have a similar construction:
|
||||
|
||||
```json
|
||||
{
|
||||
"tokens": [
|
||||
{
|
||||
"token": "token_to_copy",
|
||||
"name": "device_name",
|
||||
"date": "date"
|
||||
}
|
||||
```
|
||||
|
||||
Copy the token from the file and paste it in the next window.
|
||||
|
|
|
@ -565,8 +565,6 @@
|
|||
"upgrade_success": "Server upgrade started",
|
||||
"upgrade_failed": "Failed to upgrade server",
|
||||
"upgrade_server": "Upgrade server",
|
||||
"collect_nix_garbage": "Collect system garbage",
|
||||
"collect_nix_garbage_failed": "Failed to collect system garbage",
|
||||
"reboot_server": "Reboot server",
|
||||
"create_ssh_key": "Create SSH key for {}",
|
||||
"delete_ssh_key": "Delete SSH key for {}",
|
||||
|
@ -608,16 +606,5 @@
|
|||
"reset_onboarding": "Reset onboarding switch",
|
||||
"reset_onboarding_description": "Reset onboarding switch to show onboarding screen again",
|
||||
"cubit_statuses": "Cubit loading statuses"
|
||||
},
|
||||
"countries": {
|
||||
"germany": "Germany",
|
||||
"netherlands": "Netherlands",
|
||||
"singapore": "Singapore",
|
||||
"united_kingdom": "United Kingdom",
|
||||
"canada": "Canada",
|
||||
"india": "India",
|
||||
"australia": "Australia",
|
||||
"united_states": "United States",
|
||||
"finland": "Finland"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
app-id: org.selfprivacy.app
|
||||
runtime: org.freedesktop.Platform
|
||||
runtime-version: '23.08'
|
||||
runtime-version: '22.08'
|
||||
sdk: org.freedesktop.Sdk
|
||||
command: selfprivacy
|
||||
finish-args:
|
||||
|
@ -11,7 +11,6 @@ finish-args:
|
|||
- "--share=network"
|
||||
- "--own-name=org.selfprivacy.app"
|
||||
- "--device=dri"
|
||||
- "--talk-name=org.freedesktop.secrets"
|
||||
modules:
|
||||
- name: selfprivacy
|
||||
buildsystem: simple
|
||||
|
@ -36,7 +35,7 @@ modules:
|
|||
sources:
|
||||
- type: git
|
||||
url: https://gitlab.gnome.org/GNOME/libsecret.git
|
||||
tag: 0.21.4
|
||||
tag: 0.20.5
|
||||
- name: libjsoncpp
|
||||
buildsystem: meson
|
||||
config-opts:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart';
|
||||
|
@ -28,47 +28,33 @@ class HiveConfig {
|
|||
|
||||
await Hive.openBox(BNames.appSettingsBox);
|
||||
|
||||
try {
|
||||
final HiveAesCipher cipher = HiveAesCipher(
|
||||
await getEncryptedKey(BNames.serverInstallationEncryptionKey),
|
||||
);
|
||||
final HiveAesCipher cipher = HiveAesCipher(
|
||||
await getEncryptedKey(BNames.serverInstallationEncryptionKey),
|
||||
);
|
||||
|
||||
await Hive.openBox<User>(BNames.usersDeprecated);
|
||||
await Hive.openBox<User>(BNames.usersBox, encryptionCipher: cipher);
|
||||
await Hive.openBox<User>(BNames.usersDeprecated);
|
||||
await Hive.openBox<User>(BNames.usersBox, encryptionCipher: cipher);
|
||||
|
||||
final Box<User> deprecatedUsers = Hive.box<User>(BNames.usersDeprecated);
|
||||
if (deprecatedUsers.isNotEmpty) {
|
||||
final Box<User> users = Hive.box<User>(BNames.usersBox);
|
||||
await users.addAll(deprecatedUsers.values.toList());
|
||||
await deprecatedUsers.clear();
|
||||
}
|
||||
|
||||
await Hive.openBox(
|
||||
BNames.serverInstallationBox,
|
||||
encryptionCipher: cipher,
|
||||
);
|
||||
} on PlatformException catch (e) {
|
||||
print('HiveConfig: Error while opening boxes: $e');
|
||||
rethrow;
|
||||
final Box<User> deprecatedUsers = Hive.box<User>(BNames.usersDeprecated);
|
||||
if (deprecatedUsers.isNotEmpty) {
|
||||
final Box<User> users = Hive.box<User>(BNames.usersBox);
|
||||
await users.addAll(deprecatedUsers.values.toList());
|
||||
await deprecatedUsers.clear();
|
||||
}
|
||||
|
||||
await Hive.openBox(BNames.serverInstallationBox, encryptionCipher: cipher);
|
||||
}
|
||||
|
||||
static Future<Uint8List> getEncryptedKey(final String encKey) async {
|
||||
const FlutterSecureStorage secureStorage = FlutterSecureStorage();
|
||||
try {
|
||||
final bool hasEncryptionKey =
|
||||
await secureStorage.containsKey(key: encKey);
|
||||
if (!hasEncryptionKey) {
|
||||
final List<int> key = Hive.generateSecureKey();
|
||||
await secureStorage.write(key: encKey, value: base64UrlEncode(key));
|
||||
}
|
||||
|
||||
final String? string = await secureStorage.read(key: encKey);
|
||||
return base64Url.decode(string!);
|
||||
} on PlatformException catch (e) {
|
||||
print('HiveConfig: Error while getting encryption key: $e');
|
||||
rethrow;
|
||||
final bool hasEncryptionKey = await secureStorage.containsKey(key: encKey);
|
||||
if (!hasEncryptionKey) {
|
||||
final List<int> key = Hive.generateSecureKey();
|
||||
await secureStorage.write(key: encKey, value: base64UrlEncode(key));
|
||||
}
|
||||
|
||||
final String? string = await secureStorage.read(key: encKey);
|
||||
return base64Url.decode(string!);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -443,7 +443,6 @@ type SystemMutations {
|
|||
runSystemUpgrade: GenericJobMutationReturn!
|
||||
rebootSystem: GenericMutationReturn!
|
||||
pullRepositoryChanges: GenericMutationReturn!
|
||||
nixCollectGarbage: GenericJobMutationReturn!
|
||||
}
|
||||
|
||||
type SystemProviderInfo {
|
||||
|
|
|
@ -79,17 +79,6 @@ mutation RunSystemUpgrade {
|
|||
}
|
||||
}
|
||||
|
||||
mutation NixCollectGarbage {
|
||||
system {
|
||||
nixCollectGarbage {
|
||||
...basicMutationReturnFields
|
||||
job {
|
||||
...basicApiJobsFields
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mutation RunSystemUpgradeFallback {
|
||||
system {
|
||||
runSystemUpgrade {
|
||||
|
|
|
@ -7043,663 +7043,6 @@ class _CopyWithStubImpl$Mutation$RunSystemUpgrade$system$runSystemUpgrade<TRes>
|
|||
CopyWith$Fragment$basicApiJobsFields.stub(_res);
|
||||
}
|
||||
|
||||
class Mutation$NixCollectGarbage {
|
||||
Mutation$NixCollectGarbage({
|
||||
required this.system,
|
||||
this.$__typename = 'Mutation',
|
||||
});
|
||||
|
||||
factory Mutation$NixCollectGarbage.fromJson(Map<String, dynamic> json) {
|
||||
final l$system = json['system'];
|
||||
final l$$__typename = json['__typename'];
|
||||
return Mutation$NixCollectGarbage(
|
||||
system: Mutation$NixCollectGarbage$system.fromJson(
|
||||
(l$system as Map<String, dynamic>)),
|
||||
$__typename: (l$$__typename as String),
|
||||
);
|
||||
}
|
||||
|
||||
final Mutation$NixCollectGarbage$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 Mutation$NixCollectGarbage) ||
|
||||
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$Mutation$NixCollectGarbage
|
||||
on Mutation$NixCollectGarbage {
|
||||
CopyWith$Mutation$NixCollectGarbage<Mutation$NixCollectGarbage>
|
||||
get copyWith => CopyWith$Mutation$NixCollectGarbage(
|
||||
this,
|
||||
(i) => i,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class CopyWith$Mutation$NixCollectGarbage<TRes> {
|
||||
factory CopyWith$Mutation$NixCollectGarbage(
|
||||
Mutation$NixCollectGarbage instance,
|
||||
TRes Function(Mutation$NixCollectGarbage) then,
|
||||
) = _CopyWithImpl$Mutation$NixCollectGarbage;
|
||||
|
||||
factory CopyWith$Mutation$NixCollectGarbage.stub(TRes res) =
|
||||
_CopyWithStubImpl$Mutation$NixCollectGarbage;
|
||||
|
||||
TRes call({
|
||||
Mutation$NixCollectGarbage$system? system,
|
||||
String? $__typename,
|
||||
});
|
||||
CopyWith$Mutation$NixCollectGarbage$system<TRes> get system;
|
||||
}
|
||||
|
||||
class _CopyWithImpl$Mutation$NixCollectGarbage<TRes>
|
||||
implements CopyWith$Mutation$NixCollectGarbage<TRes> {
|
||||
_CopyWithImpl$Mutation$NixCollectGarbage(
|
||||
this._instance,
|
||||
this._then,
|
||||
);
|
||||
|
||||
final Mutation$NixCollectGarbage _instance;
|
||||
|
||||
final TRes Function(Mutation$NixCollectGarbage) _then;
|
||||
|
||||
static const _undefined = <dynamic, dynamic>{};
|
||||
|
||||
TRes call({
|
||||
Object? system = _undefined,
|
||||
Object? $__typename = _undefined,
|
||||
}) =>
|
||||
_then(Mutation$NixCollectGarbage(
|
||||
system: system == _undefined || system == null
|
||||
? _instance.system
|
||||
: (system as Mutation$NixCollectGarbage$system),
|
||||
$__typename: $__typename == _undefined || $__typename == null
|
||||
? _instance.$__typename
|
||||
: ($__typename as String),
|
||||
));
|
||||
|
||||
CopyWith$Mutation$NixCollectGarbage$system<TRes> get system {
|
||||
final local$system = _instance.system;
|
||||
return CopyWith$Mutation$NixCollectGarbage$system(
|
||||
local$system, (e) => call(system: e));
|
||||
}
|
||||
}
|
||||
|
||||
class _CopyWithStubImpl$Mutation$NixCollectGarbage<TRes>
|
||||
implements CopyWith$Mutation$NixCollectGarbage<TRes> {
|
||||
_CopyWithStubImpl$Mutation$NixCollectGarbage(this._res);
|
||||
|
||||
TRes _res;
|
||||
|
||||
call({
|
||||
Mutation$NixCollectGarbage$system? system,
|
||||
String? $__typename,
|
||||
}) =>
|
||||
_res;
|
||||
|
||||
CopyWith$Mutation$NixCollectGarbage$system<TRes> get system =>
|
||||
CopyWith$Mutation$NixCollectGarbage$system.stub(_res);
|
||||
}
|
||||
|
||||
const documentNodeMutationNixCollectGarbage = DocumentNode(definitions: [
|
||||
OperationDefinitionNode(
|
||||
type: OperationType.mutation,
|
||||
name: NameNode(value: 'NixCollectGarbage'),
|
||||
variableDefinitions: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'system'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FieldNode(
|
||||
name: NameNode(value: 'nixCollectGarbage'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FragmentSpreadNode(
|
||||
name: NameNode(value: 'basicMutationReturnFields'),
|
||||
directives: [],
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: 'job'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: SelectionSetNode(selections: [
|
||||
FragmentSpreadNode(
|
||||
name: NameNode(value: 'basicApiJobsFields'),
|
||||
directives: [],
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: '__typename'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
]),
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: '__typename'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
]),
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: '__typename'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
]),
|
||||
),
|
||||
FieldNode(
|
||||
name: NameNode(value: '__typename'),
|
||||
alias: null,
|
||||
arguments: [],
|
||||
directives: [],
|
||||
selectionSet: null,
|
||||
),
|
||||
]),
|
||||
),
|
||||
fragmentDefinitionbasicMutationReturnFields,
|
||||
fragmentDefinitionbasicApiJobsFields,
|
||||
]);
|
||||
Mutation$NixCollectGarbage _parserFn$Mutation$NixCollectGarbage(
|
||||
Map<String, dynamic> data) =>
|
||||
Mutation$NixCollectGarbage.fromJson(data);
|
||||
typedef OnMutationCompleted$Mutation$NixCollectGarbage = FutureOr<void>
|
||||
Function(
|
||||
Map<String, dynamic>?,
|
||||
Mutation$NixCollectGarbage?,
|
||||
);
|
||||
|
||||
class Options$Mutation$NixCollectGarbage
|
||||
extends graphql.MutationOptions<Mutation$NixCollectGarbage> {
|
||||
Options$Mutation$NixCollectGarbage({
|
||||
String? operationName,
|
||||
graphql.FetchPolicy? fetchPolicy,
|
||||
graphql.ErrorPolicy? errorPolicy,
|
||||
graphql.CacheRereadPolicy? cacheRereadPolicy,
|
||||
Object? optimisticResult,
|
||||
Mutation$NixCollectGarbage? typedOptimisticResult,
|
||||
graphql.Context? context,
|
||||
OnMutationCompleted$Mutation$NixCollectGarbage? onCompleted,
|
||||
graphql.OnMutationUpdate<Mutation$NixCollectGarbage>? update,
|
||||
graphql.OnError? onError,
|
||||
}) : onCompletedWithParsed = onCompleted,
|
||||
super(
|
||||
operationName: operationName,
|
||||
fetchPolicy: fetchPolicy,
|
||||
errorPolicy: errorPolicy,
|
||||
cacheRereadPolicy: cacheRereadPolicy,
|
||||
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
|
||||
context: context,
|
||||
onCompleted: onCompleted == null
|
||||
? null
|
||||
: (data) => onCompleted(
|
||||
data,
|
||||
data == null
|
||||
? null
|
||||
: _parserFn$Mutation$NixCollectGarbage(data),
|
||||
),
|
||||
update: update,
|
||||
onError: onError,
|
||||
document: documentNodeMutationNixCollectGarbage,
|
||||
parserFn: _parserFn$Mutation$NixCollectGarbage,
|
||||
);
|
||||
|
||||
final OnMutationCompleted$Mutation$NixCollectGarbage? onCompletedWithParsed;
|
||||
|
||||
@override
|
||||
List<Object?> get properties => [
|
||||
...super.onCompleted == null
|
||||
? super.properties
|
||||
: super.properties.where((property) => property != onCompleted),
|
||||
onCompletedWithParsed,
|
||||
];
|
||||
}
|
||||
|
||||
class WatchOptions$Mutation$NixCollectGarbage
|
||||
extends graphql.WatchQueryOptions<Mutation$NixCollectGarbage> {
|
||||
WatchOptions$Mutation$NixCollectGarbage({
|
||||
String? operationName,
|
||||
graphql.FetchPolicy? fetchPolicy,
|
||||
graphql.ErrorPolicy? errorPolicy,
|
||||
graphql.CacheRereadPolicy? cacheRereadPolicy,
|
||||
Object? optimisticResult,
|
||||
Mutation$NixCollectGarbage? typedOptimisticResult,
|
||||
graphql.Context? context,
|
||||
Duration? pollInterval,
|
||||
bool? eagerlyFetchResults,
|
||||
bool carryForwardDataOnException = true,
|
||||
bool fetchResults = false,
|
||||
}) : super(
|
||||
operationName: operationName,
|
||||
fetchPolicy: fetchPolicy,
|
||||
errorPolicy: errorPolicy,
|
||||
cacheRereadPolicy: cacheRereadPolicy,
|
||||
optimisticResult: optimisticResult ?? typedOptimisticResult?.toJson(),
|
||||
context: context,
|
||||
document: documentNodeMutationNixCollectGarbage,
|
||||
pollInterval: pollInterval,
|
||||
eagerlyFetchResults: eagerlyFetchResults,
|
||||
carryForwardDataOnException: carryForwardDataOnException,
|
||||
fetchResults: fetchResults,
|
||||
parserFn: _parserFn$Mutation$NixCollectGarbage,
|
||||
);
|
||||
}
|
||||
|
||||
extension ClientExtension$Mutation$NixCollectGarbage on graphql.GraphQLClient {
|
||||
Future<graphql.QueryResult<Mutation$NixCollectGarbage>>
|
||||
mutate$NixCollectGarbage(
|
||||
[Options$Mutation$NixCollectGarbage? options]) async =>
|
||||
await this.mutate(options ?? Options$Mutation$NixCollectGarbage());
|
||||
graphql.ObservableQuery<
|
||||
Mutation$NixCollectGarbage> watchMutation$NixCollectGarbage(
|
||||
[WatchOptions$Mutation$NixCollectGarbage? options]) =>
|
||||
this.watchMutation(options ?? WatchOptions$Mutation$NixCollectGarbage());
|
||||
}
|
||||
|
||||
class Mutation$NixCollectGarbage$system {
|
||||
Mutation$NixCollectGarbage$system({
|
||||
required this.nixCollectGarbage,
|
||||
this.$__typename = 'SystemMutations',
|
||||
});
|
||||
|
||||
factory Mutation$NixCollectGarbage$system.fromJson(
|
||||
Map<String, dynamic> json) {
|
||||
final l$nixCollectGarbage = json['nixCollectGarbage'];
|
||||
final l$$__typename = json['__typename'];
|
||||
return Mutation$NixCollectGarbage$system(
|
||||
nixCollectGarbage:
|
||||
Mutation$NixCollectGarbage$system$nixCollectGarbage.fromJson(
|
||||
(l$nixCollectGarbage as Map<String, dynamic>)),
|
||||
$__typename: (l$$__typename as String),
|
||||
);
|
||||
}
|
||||
|
||||
final Mutation$NixCollectGarbage$system$nixCollectGarbage nixCollectGarbage;
|
||||
|
||||
final String $__typename;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _resultData = <String, dynamic>{};
|
||||
final l$nixCollectGarbage = nixCollectGarbage;
|
||||
_resultData['nixCollectGarbage'] = l$nixCollectGarbage.toJson();
|
||||
final l$$__typename = $__typename;
|
||||
_resultData['__typename'] = l$$__typename;
|
||||
return _resultData;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final l$nixCollectGarbage = nixCollectGarbage;
|
||||
final l$$__typename = $__typename;
|
||||
return Object.hashAll([
|
||||
l$nixCollectGarbage,
|
||||
l$$__typename,
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (!(other is Mutation$NixCollectGarbage$system) ||
|
||||
runtimeType != other.runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final l$nixCollectGarbage = nixCollectGarbage;
|
||||
final lOther$nixCollectGarbage = other.nixCollectGarbage;
|
||||
if (l$nixCollectGarbage != lOther$nixCollectGarbage) {
|
||||
return false;
|
||||
}
|
||||
final l$$__typename = $__typename;
|
||||
final lOther$$__typename = other.$__typename;
|
||||
if (l$$__typename != lOther$$__typename) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
extension UtilityExtension$Mutation$NixCollectGarbage$system
|
||||
on Mutation$NixCollectGarbage$system {
|
||||
CopyWith$Mutation$NixCollectGarbage$system<Mutation$NixCollectGarbage$system>
|
||||
get copyWith => CopyWith$Mutation$NixCollectGarbage$system(
|
||||
this,
|
||||
(i) => i,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class CopyWith$Mutation$NixCollectGarbage$system<TRes> {
|
||||
factory CopyWith$Mutation$NixCollectGarbage$system(
|
||||
Mutation$NixCollectGarbage$system instance,
|
||||
TRes Function(Mutation$NixCollectGarbage$system) then,
|
||||
) = _CopyWithImpl$Mutation$NixCollectGarbage$system;
|
||||
|
||||
factory CopyWith$Mutation$NixCollectGarbage$system.stub(TRes res) =
|
||||
_CopyWithStubImpl$Mutation$NixCollectGarbage$system;
|
||||
|
||||
TRes call({
|
||||
Mutation$NixCollectGarbage$system$nixCollectGarbage? nixCollectGarbage,
|
||||
String? $__typename,
|
||||
});
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage<TRes>
|
||||
get nixCollectGarbage;
|
||||
}
|
||||
|
||||
class _CopyWithImpl$Mutation$NixCollectGarbage$system<TRes>
|
||||
implements CopyWith$Mutation$NixCollectGarbage$system<TRes> {
|
||||
_CopyWithImpl$Mutation$NixCollectGarbage$system(
|
||||
this._instance,
|
||||
this._then,
|
||||
);
|
||||
|
||||
final Mutation$NixCollectGarbage$system _instance;
|
||||
|
||||
final TRes Function(Mutation$NixCollectGarbage$system) _then;
|
||||
|
||||
static const _undefined = <dynamic, dynamic>{};
|
||||
|
||||
TRes call({
|
||||
Object? nixCollectGarbage = _undefined,
|
||||
Object? $__typename = _undefined,
|
||||
}) =>
|
||||
_then(Mutation$NixCollectGarbage$system(
|
||||
nixCollectGarbage:
|
||||
nixCollectGarbage == _undefined || nixCollectGarbage == null
|
||||
? _instance.nixCollectGarbage
|
||||
: (nixCollectGarbage
|
||||
as Mutation$NixCollectGarbage$system$nixCollectGarbage),
|
||||
$__typename: $__typename == _undefined || $__typename == null
|
||||
? _instance.$__typename
|
||||
: ($__typename as String),
|
||||
));
|
||||
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage<TRes>
|
||||
get nixCollectGarbage {
|
||||
final local$nixCollectGarbage = _instance.nixCollectGarbage;
|
||||
return CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage(
|
||||
local$nixCollectGarbage, (e) => call(nixCollectGarbage: e));
|
||||
}
|
||||
}
|
||||
|
||||
class _CopyWithStubImpl$Mutation$NixCollectGarbage$system<TRes>
|
||||
implements CopyWith$Mutation$NixCollectGarbage$system<TRes> {
|
||||
_CopyWithStubImpl$Mutation$NixCollectGarbage$system(this._res);
|
||||
|
||||
TRes _res;
|
||||
|
||||
call({
|
||||
Mutation$NixCollectGarbage$system$nixCollectGarbage? nixCollectGarbage,
|
||||
String? $__typename,
|
||||
}) =>
|
||||
_res;
|
||||
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage<TRes>
|
||||
get nixCollectGarbage =>
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage.stub(
|
||||
_res);
|
||||
}
|
||||
|
||||
class Mutation$NixCollectGarbage$system$nixCollectGarbage
|
||||
implements Fragment$basicMutationReturnFields$$GenericJobMutationReturn {
|
||||
Mutation$NixCollectGarbage$system$nixCollectGarbage({
|
||||
required this.code,
|
||||
required this.message,
|
||||
required this.success,
|
||||
this.$__typename = 'GenericJobMutationReturn',
|
||||
this.job,
|
||||
});
|
||||
|
||||
factory Mutation$NixCollectGarbage$system$nixCollectGarbage.fromJson(
|
||||
Map<String, dynamic> json) {
|
||||
final l$code = json['code'];
|
||||
final l$message = json['message'];
|
||||
final l$success = json['success'];
|
||||
final l$$__typename = json['__typename'];
|
||||
final l$job = json['job'];
|
||||
return Mutation$NixCollectGarbage$system$nixCollectGarbage(
|
||||
code: (l$code as int),
|
||||
message: (l$message as String),
|
||||
success: (l$success as bool),
|
||||
$__typename: (l$$__typename as String),
|
||||
job: l$job == null
|
||||
? null
|
||||
: Fragment$basicApiJobsFields.fromJson(
|
||||
(l$job as Map<String, dynamic>)),
|
||||
);
|
||||
}
|
||||
|
||||
final int code;
|
||||
|
||||
final String message;
|
||||
|
||||
final bool success;
|
||||
|
||||
final String $__typename;
|
||||
|
||||
final Fragment$basicApiJobsFields? job;
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final _resultData = <String, dynamic>{};
|
||||
final l$code = code;
|
||||
_resultData['code'] = l$code;
|
||||
final l$message = message;
|
||||
_resultData['message'] = l$message;
|
||||
final l$success = success;
|
||||
_resultData['success'] = l$success;
|
||||
final l$$__typename = $__typename;
|
||||
_resultData['__typename'] = l$$__typename;
|
||||
final l$job = job;
|
||||
_resultData['job'] = l$job?.toJson();
|
||||
return _resultData;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
final l$code = code;
|
||||
final l$message = message;
|
||||
final l$success = success;
|
||||
final l$$__typename = $__typename;
|
||||
final l$job = job;
|
||||
return Object.hashAll([
|
||||
l$code,
|
||||
l$message,
|
||||
l$success,
|
||||
l$$__typename,
|
||||
l$job,
|
||||
]);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) {
|
||||
return true;
|
||||
}
|
||||
if (!(other is Mutation$NixCollectGarbage$system$nixCollectGarbage) ||
|
||||
runtimeType != other.runtimeType) {
|
||||
return false;
|
||||
}
|
||||
final l$code = code;
|
||||
final lOther$code = other.code;
|
||||
if (l$code != lOther$code) {
|
||||
return false;
|
||||
}
|
||||
final l$message = message;
|
||||
final lOther$message = other.message;
|
||||
if (l$message != lOther$message) {
|
||||
return false;
|
||||
}
|
||||
final l$success = success;
|
||||
final lOther$success = other.success;
|
||||
if (l$success != lOther$success) {
|
||||
return false;
|
||||
}
|
||||
final l$$__typename = $__typename;
|
||||
final lOther$$__typename = other.$__typename;
|
||||
if (l$$__typename != lOther$$__typename) {
|
||||
return false;
|
||||
}
|
||||
final l$job = job;
|
||||
final lOther$job = other.job;
|
||||
if (l$job != lOther$job) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
extension UtilityExtension$Mutation$NixCollectGarbage$system$nixCollectGarbage
|
||||
on Mutation$NixCollectGarbage$system$nixCollectGarbage {
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage<
|
||||
Mutation$NixCollectGarbage$system$nixCollectGarbage>
|
||||
get copyWith =>
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage(
|
||||
this,
|
||||
(i) => i,
|
||||
);
|
||||
}
|
||||
|
||||
abstract class CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage<
|
||||
TRes> {
|
||||
factory CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage(
|
||||
Mutation$NixCollectGarbage$system$nixCollectGarbage instance,
|
||||
TRes Function(Mutation$NixCollectGarbage$system$nixCollectGarbage) then,
|
||||
) = _CopyWithImpl$Mutation$NixCollectGarbage$system$nixCollectGarbage;
|
||||
|
||||
factory CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage.stub(
|
||||
TRes res) =
|
||||
_CopyWithStubImpl$Mutation$NixCollectGarbage$system$nixCollectGarbage;
|
||||
|
||||
TRes call({
|
||||
int? code,
|
||||
String? message,
|
||||
bool? success,
|
||||
String? $__typename,
|
||||
Fragment$basicApiJobsFields? job,
|
||||
});
|
||||
CopyWith$Fragment$basicApiJobsFields<TRes> get job;
|
||||
}
|
||||
|
||||
class _CopyWithImpl$Mutation$NixCollectGarbage$system$nixCollectGarbage<TRes>
|
||||
implements
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage<TRes> {
|
||||
_CopyWithImpl$Mutation$NixCollectGarbage$system$nixCollectGarbage(
|
||||
this._instance,
|
||||
this._then,
|
||||
);
|
||||
|
||||
final Mutation$NixCollectGarbage$system$nixCollectGarbage _instance;
|
||||
|
||||
final TRes Function(Mutation$NixCollectGarbage$system$nixCollectGarbage)
|
||||
_then;
|
||||
|
||||
static const _undefined = <dynamic, dynamic>{};
|
||||
|
||||
TRes call({
|
||||
Object? code = _undefined,
|
||||
Object? message = _undefined,
|
||||
Object? success = _undefined,
|
||||
Object? $__typename = _undefined,
|
||||
Object? job = _undefined,
|
||||
}) =>
|
||||
_then(Mutation$NixCollectGarbage$system$nixCollectGarbage(
|
||||
code:
|
||||
code == _undefined || code == null ? _instance.code : (code as int),
|
||||
message: message == _undefined || message == null
|
||||
? _instance.message
|
||||
: (message as String),
|
||||
success: success == _undefined || success == null
|
||||
? _instance.success
|
||||
: (success as bool),
|
||||
$__typename: $__typename == _undefined || $__typename == null
|
||||
? _instance.$__typename
|
||||
: ($__typename as String),
|
||||
job: job == _undefined
|
||||
? _instance.job
|
||||
: (job as Fragment$basicApiJobsFields?),
|
||||
));
|
||||
|
||||
CopyWith$Fragment$basicApiJobsFields<TRes> get job {
|
||||
final local$job = _instance.job;
|
||||
return local$job == null
|
||||
? CopyWith$Fragment$basicApiJobsFields.stub(_then(_instance))
|
||||
: CopyWith$Fragment$basicApiJobsFields(local$job, (e) => call(job: e));
|
||||
}
|
||||
}
|
||||
|
||||
class _CopyWithStubImpl$Mutation$NixCollectGarbage$system$nixCollectGarbage<
|
||||
TRes>
|
||||
implements
|
||||
CopyWith$Mutation$NixCollectGarbage$system$nixCollectGarbage<TRes> {
|
||||
_CopyWithStubImpl$Mutation$NixCollectGarbage$system$nixCollectGarbage(
|
||||
this._res);
|
||||
|
||||
TRes _res;
|
||||
|
||||
call({
|
||||
int? code,
|
||||
String? message,
|
||||
bool? success,
|
||||
String? $__typename,
|
||||
Fragment$basicApiJobsFields? job,
|
||||
}) =>
|
||||
_res;
|
||||
|
||||
CopyWith$Fragment$basicApiJobsFields<TRes> get job =>
|
||||
CopyWith$Fragment$basicApiJobsFields.stub(_res);
|
||||
}
|
||||
|
||||
class Mutation$RunSystemUpgradeFallback {
|
||||
Mutation$RunSystemUpgradeFallback({
|
||||
required this.system,
|
||||
|
|
|
@ -144,38 +144,4 @@ mixin ServerActionsApi on GraphQLApiMap {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<GenericResult<ServerJob?>> collectNixGarbage() async {
|
||||
try {
|
||||
final GraphQLClient client = await getClient();
|
||||
final result = await client.mutate$NixCollectGarbage();
|
||||
if (result.hasException) {
|
||||
return GenericResult(
|
||||
success: false,
|
||||
data: null,
|
||||
);
|
||||
} else if (result.parsedData!.system.nixCollectGarbage.success &&
|
||||
result.parsedData!.system.nixCollectGarbage.job != null) {
|
||||
return GenericResult(
|
||||
success: true,
|
||||
data: ServerJob.fromGraphQL(
|
||||
result.parsedData!.system.nixCollectGarbage.job!,
|
||||
),
|
||||
message: result.parsedData!.system.nixCollectGarbage.message,
|
||||
);
|
||||
} else {
|
||||
return GenericResult(
|
||||
success: false,
|
||||
message: result.parsedData!.system.nixCollectGarbage.message,
|
||||
data: null,
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
return GenericResult(
|
||||
success: false,
|
||||
message: e.toString(),
|
||||
data: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,45 +178,6 @@ class JobsCubit extends Cubit<JobsState> {
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> collectNixGarbage() async {
|
||||
if (state is JobsStateEmpty) {
|
||||
emit(
|
||||
JobsStateLoading(
|
||||
[CollectNixGarbageJob(status: JobStatusEnum.running)],
|
||||
null,
|
||||
const [],
|
||||
),
|
||||
);
|
||||
final result =
|
||||
await getIt<ApiConnectionRepository>().api.collectNixGarbage();
|
||||
if (result.success && result.data != null) {
|
||||
emit(
|
||||
JobsStateLoading(
|
||||
[CollectNixGarbageJob(status: JobStatusEnum.finished)],
|
||||
result.data!.uid,
|
||||
const [],
|
||||
),
|
||||
);
|
||||
} else if (result.success) {
|
||||
emit(
|
||||
JobsStateFinished(
|
||||
[CollectNixGarbageJob(status: JobStatusEnum.finished)],
|
||||
null,
|
||||
const [],
|
||||
),
|
||||
);
|
||||
} else {
|
||||
emit(
|
||||
JobsStateFinished(
|
||||
[CollectNixGarbageJob(status: JobStatusEnum.error)],
|
||||
null,
|
||||
const [],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> acknowledgeFinished() async {
|
||||
if (state is! JobsStateFinished) {
|
||||
return;
|
||||
|
|
|
@ -62,36 +62,6 @@ class UpgradeServerJob extends ClientJob {
|
|||
);
|
||||
}
|
||||
|
||||
class CollectNixGarbageJob extends ClientJob {
|
||||
CollectNixGarbageJob({
|
||||
super.status,
|
||||
super.message,
|
||||
super.id,
|
||||
}) : super(title: 'jobs.collect_nix_garbage'.tr());
|
||||
|
||||
@override
|
||||
bool canAddTo(final List<ClientJob> jobs) =>
|
||||
!jobs.any((final job) => job is CollectNixGarbageJob);
|
||||
|
||||
@override
|
||||
Future<(bool, String)> execute() async {
|
||||
final result =
|
||||
await getIt<ApiConnectionRepository>().api.collectNixGarbage();
|
||||
return (result.success, result.message ?? '');
|
||||
}
|
||||
|
||||
@override
|
||||
CollectNixGarbageJob copyWithNewStatus({
|
||||
required final JobStatusEnum status,
|
||||
final String? message,
|
||||
}) =>
|
||||
CollectNixGarbageJob(
|
||||
status: status,
|
||||
message: message,
|
||||
id: id,
|
||||
);
|
||||
}
|
||||
|
||||
class RebootServerJob extends ClientJob {
|
||||
RebootServerJob({
|
||||
super.status,
|
||||
|
|
|
@ -65,59 +65,14 @@ class DigitalOceanLocation {
|
|||
emoji = '🇮🇳';
|
||||
break;
|
||||
|
||||
case 'syd':
|
||||
emoji = '🇦🇺';
|
||||
break;
|
||||
|
||||
case 'nyc':
|
||||
case 'sfo':
|
||||
emoji = '🇺🇸';
|
||||
break;
|
||||
}
|
||||
|
||||
return emoji;
|
||||
}
|
||||
|
||||
String get countryDisplayKey {
|
||||
String displayKey = 'countries.';
|
||||
switch (slug.substring(0, 3)) {
|
||||
case 'fra':
|
||||
displayKey += 'germany';
|
||||
break;
|
||||
|
||||
case 'ams':
|
||||
displayKey += 'netherlands';
|
||||
break;
|
||||
|
||||
case 'sgp':
|
||||
displayKey += 'singapore';
|
||||
break;
|
||||
|
||||
case 'lon':
|
||||
displayKey += 'united_kingdom';
|
||||
break;
|
||||
|
||||
case 'tor':
|
||||
displayKey += 'canada';
|
||||
break;
|
||||
|
||||
case 'blr':
|
||||
displayKey += 'india';
|
||||
break;
|
||||
|
||||
case 'syd':
|
||||
displayKey += 'australia';
|
||||
break;
|
||||
|
||||
case 'nyc':
|
||||
case 'sfo':
|
||||
displayKey += 'united_states';
|
||||
break;
|
||||
|
||||
default:
|
||||
displayKey = slug;
|
||||
}
|
||||
return displayKey;
|
||||
}
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
|
|
|
@ -155,27 +155,6 @@ class HetznerLocation {
|
|||
}
|
||||
return emoji;
|
||||
}
|
||||
|
||||
String get countryDisplayKey {
|
||||
String displayKey = 'countries.';
|
||||
switch (country.substring(0, 2)) {
|
||||
case 'DE':
|
||||
displayKey += 'germany';
|
||||
break;
|
||||
|
||||
case 'FI':
|
||||
displayKey += 'finland';
|
||||
break;
|
||||
|
||||
case 'US':
|
||||
displayKey += 'united_states';
|
||||
break;
|
||||
|
||||
default:
|
||||
displayKey = country;
|
||||
}
|
||||
return displayKey;
|
||||
}
|
||||
}
|
||||
|
||||
/// A Volume is a highly-available, scalable, and SSD-based block storage for Servers.
|
||||
|
|
|
@ -2,14 +2,12 @@ class ServerProviderLocation {
|
|||
ServerProviderLocation({
|
||||
required this.title,
|
||||
required this.identifier,
|
||||
required this.countryDisplayKey,
|
||||
this.description,
|
||||
this.flag = '',
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String identifier;
|
||||
final String countryDisplayKey;
|
||||
final String? description;
|
||||
final String flag;
|
||||
}
|
||||
|
|
|
@ -438,7 +438,6 @@ class DigitalOceanServerProvider extends ServerProvider {
|
|||
description: rawLocation.name,
|
||||
flag: rawLocation.flag,
|
||||
identifier: rawLocation.slug,
|
||||
countryDisplayKey: rawLocation.countryDisplayKey,
|
||||
);
|
||||
} catch (e) {
|
||||
continue;
|
||||
|
|
|
@ -156,7 +156,6 @@ class HetznerServerProvider extends ServerProvider {
|
|||
description: server.location.description,
|
||||
flag: server.location.flag,
|
||||
identifier: server.location.name,
|
||||
countryDisplayKey: server.location.countryDisplayKey,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -457,7 +456,6 @@ class HetznerServerProvider extends ServerProvider {
|
|||
description: rawLocation.description,
|
||||
flag: rawLocation.flag,
|
||||
identifier: rawLocation.name,
|
||||
countryDisplayKey: rawLocation.countryDisplayKey,
|
||||
);
|
||||
} catch (e) {
|
||||
continue;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:selfprivacy/config/bloc_config.dart';
|
||||
import 'package:selfprivacy/config/bloc_observer.dart';
|
||||
|
@ -10,20 +9,13 @@ import 'package:selfprivacy/config/hive_config.dart';
|
|||
import 'package:selfprivacy/config/localization.dart';
|
||||
import 'package:selfprivacy/logic/cubit/app_settings/app_settings_cubit.dart';
|
||||
import 'package:selfprivacy/theming/factory/app_theme_factory.dart';
|
||||
import 'package:selfprivacy/ui/pages/errors/failed_to_init_secure_storage.dart';
|
||||
import 'package:selfprivacy/ui/router/router.dart';
|
||||
// import 'package:wakelock/wakelock.dart';
|
||||
import 'package:timezone/data/latest.dart' as tz;
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
try {
|
||||
await HiveConfig.init();
|
||||
} on PlatformException catch (e) {
|
||||
runApp(
|
||||
FailedToInitSecureStorageScreen(e: e),
|
||||
);
|
||||
}
|
||||
await HiveConfig.init();
|
||||
// await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
||||
|
||||
// try {
|
||||
|
|
|
@ -24,10 +24,8 @@ abstract class AppThemeFactory {
|
|||
final ColorScheme? dynamicColorsScheme =
|
||||
await _getDynamicColors(brightness);
|
||||
|
||||
final Color? accentColor = await _getAccentColor();
|
||||
|
||||
final ColorScheme fallbackColorScheme = ColorScheme.fromSeed(
|
||||
seedColor: accentColor ?? fallbackColor,
|
||||
seedColor: fallbackColor,
|
||||
brightness: brightness,
|
||||
);
|
||||
|
||||
|
@ -57,14 +55,6 @@ abstract class AppThemeFactory {
|
|||
}
|
||||
}
|
||||
|
||||
static Future<Color?> _getAccentColor() {
|
||||
try {
|
||||
return DynamicColorPlugin.getAccentColor();
|
||||
} on PlatformException {
|
||||
return Future.value(null);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<CorePalette?> getCorePalette() async {
|
||||
try {
|
||||
return await DynamicColorPlugin.getCorePalette();
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:collection/collection.dart';
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:selfprivacy/config/brand_theme.dart';
|
||||
import 'package:selfprivacy/logic/bloc/server_jobs/server_jobs_bloc.dart';
|
||||
import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
|
||||
|
@ -64,7 +63,7 @@ class JobsContent extends StatelessWidget {
|
|||
context.read<ServerInstallationCubit>().state;
|
||||
if (state is JobsStateEmpty) {
|
||||
widgets = [
|
||||
const Gap(80),
|
||||
const SizedBox(height: 80),
|
||||
Center(
|
||||
child: Text(
|
||||
'jobs.empty'.tr(),
|
||||
|
@ -76,12 +75,12 @@ class JobsContent extends StatelessWidget {
|
|||
if (installationState is ServerInstallationFinished) {
|
||||
widgets = [
|
||||
...widgets,
|
||||
const Gap(80),
|
||||
const SizedBox(height: 80),
|
||||
BrandButton.rised(
|
||||
onPressed: () => context.read<JobsCubit>().upgradeServer(),
|
||||
text: 'jobs.upgrade_server'.tr(),
|
||||
),
|
||||
const Gap(10),
|
||||
const SizedBox(height: 10),
|
||||
BrandButton.text(
|
||||
title: 'jobs.reboot_server'.tr(),
|
||||
onPressed: () {
|
||||
|
@ -190,7 +189,7 @@ class JobsContent extends StatelessWidget {
|
|||
style:
|
||||
Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
const Gap(8),
|
||||
const SizedBox(height: 8),
|
||||
LinearProgressIndicator(
|
||||
value: rebuildJob?.progress == null
|
||||
? 0.0
|
||||
|
@ -207,7 +206,7 @@ class JobsContent extends StatelessWidget {
|
|||
minHeight: 7.0,
|
||||
borderRadius: BorderRadius.circular(7.0),
|
||||
),
|
||||
const Gap(8),
|
||||
const SizedBox(height: 8),
|
||||
if (rebuildJob?.error != null ||
|
||||
rebuildJob?.result != null ||
|
||||
rebuildJob?.statusText != null)
|
||||
|
@ -283,7 +282,7 @@ class JobsContent extends StatelessWidget {
|
|||
(final job) => job.uid == state.rebuildJobUid,
|
||||
);
|
||||
if (rebuildJob == null) {
|
||||
return const Gap(0);
|
||||
return const SizedBox();
|
||||
}
|
||||
return Row(
|
||||
children: [
|
||||
|
@ -323,7 +322,7 @@ class JobsContent extends StatelessWidget {
|
|||
rebuildJob.description,
|
||||
style: Theme.of(context).textTheme.labelSmall,
|
||||
),
|
||||
const Gap(8),
|
||||
const SizedBox(height: 8),
|
||||
LinearProgressIndicator(
|
||||
value: rebuildJob.progress == null
|
||||
? 0.0
|
||||
|
@ -340,7 +339,7 @@ class JobsContent extends StatelessWidget {
|
|||
minHeight: 7.0,
|
||||
borderRadius: BorderRadius.circular(7.0),
|
||||
),
|
||||
const Gap(8),
|
||||
const SizedBox(height: 8),
|
||||
if (rebuildJob.error != null ||
|
||||
rebuildJob.result != null ||
|
||||
rebuildJob.statusText != null)
|
||||
|
@ -361,7 +360,7 @@ class JobsContent extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
),
|
||||
const Gap(16),
|
||||
const SizedBox(height: 16),
|
||||
BrandButton.rised(
|
||||
onPressed: () => context.read<JobsCubit>().acknowledgeFinished(),
|
||||
text: 'basis.done'.tr(),
|
||||
|
@ -404,7 +403,7 @@ class JobsContent extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
const Gap(8),
|
||||
const SizedBox(width: 8),
|
||||
ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor:
|
||||
|
@ -424,7 +423,7 @@ class JobsContent extends StatelessWidget {
|
|||
],
|
||||
),
|
||||
),
|
||||
const Gap(16),
|
||||
const SizedBox(height: 16),
|
||||
BrandButton.rised(
|
||||
onPressed: hasBlockingJobs
|
||||
? null
|
||||
|
@ -437,18 +436,18 @@ class JobsContent extends StatelessWidget {
|
|||
controller: controller,
|
||||
padding: paddingH15V0,
|
||||
children: [
|
||||
const Gap(16),
|
||||
const SizedBox(height: 16),
|
||||
Center(
|
||||
child: Text(
|
||||
'jobs.title'.tr(),
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
),
|
||||
const Gap(20),
|
||||
const SizedBox(height: 20),
|
||||
...widgets,
|
||||
const Gap(8),
|
||||
const SizedBox(height: 8),
|
||||
const Divider(height: 0),
|
||||
const Gap(8),
|
||||
const SizedBox(height: 8),
|
||||
if (serverJobs.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
@ -490,7 +489,7 @@ class JobsContent extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
),
|
||||
const Gap(24),
|
||||
const SizedBox(height: 24),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:ionicons/ionicons.dart';
|
||||
import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
|
||||
|
@ -127,9 +126,7 @@ class _HeroSliverAppBarState extends State<HeroSliverAppBar> {
|
|||
Widget build(final BuildContext context) {
|
||||
final isMobile =
|
||||
widget.ignoreBreakpoints ? true : Breakpoints.small.isActive(context);
|
||||
final isJobsListEmpty = widget.hasFlashButton
|
||||
? context.watch<JobsCubit>().state is JobsStateEmpty
|
||||
: true;
|
||||
final isJobsListEmpty = context.watch<JobsCubit>().state is JobsStateEmpty;
|
||||
return SliverAppBar(
|
||||
expandedHeight:
|
||||
widget.hasHeroIcon ? 148.0 + _size.height : 72.0 + _size.height,
|
||||
|
@ -167,7 +164,6 @@ class _HeroSliverAppBarState extends State<HeroSliverAppBar> {
|
|||
color: isJobsListEmpty
|
||||
? Theme.of(context).colorScheme.onBackground
|
||||
: Theme.of(context).colorScheme.primary,
|
||||
tooltip: 'jobs.title'.tr(),
|
||||
),
|
||||
),
|
||||
const SizedBox.shrink(),
|
||||
|
|
|
@ -100,7 +100,7 @@ class _RootAppBar extends StatelessWidget {
|
|||
leading: context.router.pageCount > 1
|
||||
? IconButton(
|
||||
icon: const Icon(Icons.arrow_back),
|
||||
onPressed: () => context.router.maybePop(),
|
||||
onPressed: () => context.router.pop(),
|
||||
)
|
||||
: null,
|
||||
actions: const [
|
||||
|
|
|
@ -38,14 +38,8 @@ class BackupDetailsPage extends StatelessWidget {
|
|||
: StateType.uninitialized;
|
||||
final bool preventActions = backupsState.preventActions;
|
||||
final List<Backup> backups = backupsState.backups;
|
||||
final List<Service> services = context
|
||||
.watch<ServicesBloc>()
|
||||
.state
|
||||
.servicesThatCanBeBackedUp
|
||||
.where(
|
||||
(final service) => service.isEnabled,
|
||||
)
|
||||
.toList();
|
||||
final List<Service> services =
|
||||
context.watch<ServicesBloc>().state.servicesThatCanBeBackedUp;
|
||||
final Duration? autobackupPeriod = backupsState.autobackupPeriod;
|
||||
final List<ServerJob> backupJobs = context
|
||||
.watch<ServerJobsBloc>()
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:selfprivacy/logic/bloc/backups/backups_bloc.dart';
|
||||
import 'package:selfprivacy/logic/bloc/server_jobs/server_jobs_bloc.dart';
|
||||
import 'package:selfprivacy/logic/bloc/volumes/volumes_bloc.dart';
|
||||
import 'package:selfprivacy/logic/models/json/server_job.dart';
|
||||
import 'package:selfprivacy/logic/models/service.dart';
|
||||
|
||||
|
@ -104,29 +103,6 @@ class _CreateBackupsModalState extends State<CreateBackupsModal> {
|
|||
...widget.services.map(
|
||||
(final Service service) {
|
||||
final bool busy = busyServices.contains(service.id);
|
||||
final List<Widget> descriptionWidgets = [];
|
||||
if (busy) {
|
||||
descriptionWidgets.add(Text('backup.service_busy'.tr()));
|
||||
} else {
|
||||
descriptionWidgets.add(
|
||||
Text(
|
||||
'service_page.uses'.tr(
|
||||
namedArgs: {
|
||||
'usage': service.storageUsage.used.toString(),
|
||||
'volume': context
|
||||
.read<VolumesBloc>()
|
||||
.state
|
||||
.getVolume(service.storageUsage.volume ?? '')
|
||||
.displayName,
|
||||
},
|
||||
),
|
||||
style: Theme.of(context).textTheme.labelMedium,
|
||||
),
|
||||
);
|
||||
descriptionWidgets.add(
|
||||
Text(service.backupDescription),
|
||||
);
|
||||
}
|
||||
return CheckboxListTile.adaptive(
|
||||
onChanged: !busy
|
||||
? (final bool? value) {
|
||||
|
@ -146,9 +122,8 @@ class _CreateBackupsModalState extends State<CreateBackupsModal> {
|
|||
title: Text(
|
||||
service.displayName,
|
||||
),
|
||||
subtitle: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: descriptionWidgets,
|
||||
subtitle: Text(
|
||||
busy ? 'backup.service_busy'.tr() : service.backupDescription,
|
||||
),
|
||||
secondary: SvgPicture.string(
|
||||
service.svgIcon,
|
||||
|
|
|
@ -1,71 +0,0 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/pages/more/about_application.dart';
|
||||
|
||||
class FailedToInitSecureStorageScreen extends StatelessWidget {
|
||||
const FailedToInitSecureStorageScreen({
|
||||
required this.e,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final PlatformException e;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => MaterialApp(
|
||||
home: BrandHeroScreen(
|
||||
heroIcon: Icons.error_outline,
|
||||
heroTitle: 'Failed to initialize secure storage',
|
||||
hasBackButton: false,
|
||||
children: [
|
||||
const Text(
|
||||
'SelfPrivacy requires a secure storage provided by your operating system to encrypt sensitive data, but it failed to initialize.',
|
||||
),
|
||||
if (Platform.isLinux)
|
||||
const Text(
|
||||
'Please make sure that the libsecret library is installed.',
|
||||
),
|
||||
const Gap(16),
|
||||
Text('Error: ${e.message}'),
|
||||
const Gap(16),
|
||||
const Divider(),
|
||||
const Gap(16),
|
||||
const LinkListTile(
|
||||
title: 'Our website',
|
||||
subtitle: 'selfprivacy.org',
|
||||
uri: 'https://selfprivacy.org/',
|
||||
icon: Icons.language_outlined,
|
||||
),
|
||||
const LinkListTile(
|
||||
title: 'Documentation',
|
||||
subtitle: 'selfprivacy.org/docs',
|
||||
uri: 'https://selfprivacy.org/docs/',
|
||||
icon: Icons.library_books_outlined,
|
||||
),
|
||||
const LinkListTile(
|
||||
title: 'Privacy Policy',
|
||||
subtitle: 'selfprivacy.org/privacy-policy',
|
||||
uri: 'https://selfprivacy.org/privacy-policy/',
|
||||
icon: Icons.policy_outlined,
|
||||
),
|
||||
const LinkListTile(
|
||||
title: 'Matrix support chat',
|
||||
subtitle: '#chat:selfprivacy.org',
|
||||
uri: 'https://matrix.to/#/#chat:selfprivacy.org',
|
||||
icon: Icons.question_answer_outlined,
|
||||
longPressText: '#chat:selfprivacy.org',
|
||||
),
|
||||
const LinkListTile(
|
||||
title: 'Telegram support chat',
|
||||
subtitle: '@selfprivacy_chat',
|
||||
uri: 'https://t.me/selfprivacy_chat',
|
||||
icon: Icons.question_answer_outlined,
|
||||
longPressText: '@selfprivacy_chat',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
|
@ -35,8 +35,7 @@ class CpuChart extends StatelessWidget {
|
|||
lineTouchData: LineTouchData(
|
||||
enabled: true,
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
getTooltipColor: (final LineBarSpot _) =>
|
||||
Theme.of(context).colorScheme.surface,
|
||||
tooltipBgColor: Theme.of(context).colorScheme.surface,
|
||||
tooltipPadding: const EdgeInsets.all(8),
|
||||
getTooltipItems: (final List<LineBarSpot> touchedBarSpots) {
|
||||
final List<LineTooltipItem> res = [];
|
||||
|
|
|
@ -38,8 +38,7 @@ class NetworkChart extends StatelessWidget {
|
|||
lineTouchData: LineTouchData(
|
||||
enabled: true,
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
getTooltipColor: (final LineBarSpot _) =>
|
||||
Theme.of(context).colorScheme.surface,
|
||||
tooltipBgColor: Theme.of(context).colorScheme.surface,
|
||||
tooltipPadding: const EdgeInsets.all(8),
|
||||
getTooltipItems: (final List<LineBarSpot> touchedBarSpots) {
|
||||
final List<LineTooltipItem> res = [];
|
||||
|
|
|
@ -2,9 +2,7 @@ import 'package:auto_route/auto_route.dart';
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:gap/gap.dart';
|
||||
import 'package:selfprivacy/logic/bloc/services/services_bloc.dart';
|
||||
import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
|
||||
import 'package:selfprivacy/logic/cubit/server_installation/server_installation_cubit.dart';
|
||||
import 'package:selfprivacy/logic/models/disk_status.dart';
|
||||
import 'package:selfprivacy/logic/models/service.dart';
|
||||
|
@ -45,9 +43,8 @@ class _ServerStoragePageState extends State<ServerStoragePage> {
|
|||
return BrandHeroScreen(
|
||||
hasBackButton: true,
|
||||
heroTitle: 'storage.card_title'.tr(),
|
||||
bodyPadding: const EdgeInsets.symmetric(vertical: 16.0),
|
||||
hasFlashButton: true,
|
||||
children: [
|
||||
// ...sections,
|
||||
...widget.diskStatus.diskVolumes.map(
|
||||
(final volume) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
@ -62,20 +59,13 @@ class _ServerStoragePageState extends State<ServerStoragePage> {
|
|||
)
|
||||
.toList(),
|
||||
),
|
||||
const Gap(16),
|
||||
const SizedBox(height: 16),
|
||||
const Divider(),
|
||||
const Gap(16),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Gap(8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: BrandOutlinedButton(
|
||||
title: 'jobs.collect_nix_garbage'.tr(),
|
||||
onPressed: context.read<JobsCubit>().collectNixGarbage,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
@ -97,35 +87,24 @@ class ServerStorageSection extends StatelessWidget {
|
|||
Widget build(final BuildContext context) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: ServerStorageListItem(
|
||||
volume: volume,
|
||||
),
|
||||
ServerStorageListItem(
|
||||
volume: volume,
|
||||
),
|
||||
const Gap(16),
|
||||
const SizedBox(height: 16),
|
||||
...services.map(
|
||||
(final service) => ServerConsumptionListTile(
|
||||
service: service,
|
||||
volume: volume,
|
||||
onTap: () {
|
||||
context.pushRoute(
|
||||
ServiceRoute(serviceId: service.id),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
if (volume.isResizable) ...[
|
||||
const Gap(16),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: BrandOutlinedButton(
|
||||
title: 'storage.extend_volume_button.title'.tr(),
|
||||
onPressed: () => context.pushRoute(
|
||||
ExtendingVolumeRoute(
|
||||
diskVolumeToResize: volume,
|
||||
diskStatus: diskStatus,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
BrandOutlinedButton(
|
||||
title: 'storage.extend_volume_button.title'.tr(),
|
||||
onPressed: () => context.pushRoute(
|
||||
ExtendingVolumeRoute(
|
||||
diskVolumeToResize: volume,
|
||||
diskStatus: diskStatus,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -138,38 +117,33 @@ class ServerConsumptionListTile extends StatelessWidget {
|
|||
const ServerConsumptionListTile({
|
||||
required this.service,
|
||||
required this.volume,
|
||||
required this.onTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final Service service;
|
||||
final DiskVolume volume;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(final BuildContext context) => InkWell(
|
||||
onTap: onTap,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
|
||||
child: ConsumptionListItem(
|
||||
title: service.displayName,
|
||||
icon: SvgPicture.string(
|
||||
service.svgIcon,
|
||||
width: 22.0,
|
||||
height: 24.0,
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onBackground,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
Widget build(final BuildContext context) => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: ConsumptionListItem(
|
||||
title: service.displayName,
|
||||
icon: SvgPicture.string(
|
||||
service.svgIcon,
|
||||
width: 24.0,
|
||||
height: 24.0,
|
||||
colorFilter: ColorFilter.mode(
|
||||
Theme.of(context).colorScheme.onBackground,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
rightSideText: service.storageUsage.used.toString(),
|
||||
percentage: service.storageUsage.used.byte / volume.sizeTotal.byte,
|
||||
color: volume.root
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
||||
dense: true,
|
||||
),
|
||||
rightSideText: service.storageUsage.used.toString(),
|
||||
percentage: service.storageUsage.used.byte / volume.sizeTotal.byte,
|
||||
color: volume.root
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: Theme.of(context).colorScheme.secondary,
|
||||
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
|
||||
dense: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:auto_route/auto_route.dart';
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:selfprivacy/config/get_it_config.dart';
|
||||
import 'package:selfprivacy/logic/bloc/services/services_bloc.dart';
|
||||
import 'package:selfprivacy/logic/bloc/volumes/volumes_bloc.dart';
|
||||
import 'package:selfprivacy/logic/cubit/client_jobs/client_jobs_cubit.dart';
|
||||
|
@ -12,7 +11,6 @@ import 'package:selfprivacy/ui/components/cards/filled_card.dart';
|
|||
import 'package:selfprivacy/ui/layouts/brand_hero_screen.dart';
|
||||
import 'package:selfprivacy/ui/router/router.dart';
|
||||
import 'package:selfprivacy/utils/launch_url.dart';
|
||||
import 'package:selfprivacy/utils/platform_adapter.dart';
|
||||
|
||||
@RoutePage()
|
||||
class ServicePage extends StatefulWidget {
|
||||
|
@ -67,11 +65,6 @@ class _ServicePageState extends State<ServicePage> {
|
|||
ListTile(
|
||||
iconColor: Theme.of(context).colorScheme.onBackground,
|
||||
onTap: () => launchURL(service.url),
|
||||
onLongPress: () {
|
||||
PlatformAdapter.setClipboard(service.url!);
|
||||
getIt<NavigationService>()
|
||||
.showSnackBar('basis.copied_to_clipboard'.tr());
|
||||
},
|
||||
leading: const Icon(Icons.open_in_browser),
|
||||
title: Text(
|
||||
'service_page.open_in_browser'.tr(),
|
||||
|
|
|
@ -57,7 +57,7 @@ class _DnsProviderPickerState extends State<DnsProviderPicker> {
|
|||
providerCubit: widget.formCubit,
|
||||
providerInfo: const ProviderPageInfo(
|
||||
providerType: DnsProviderType.digitalOcean,
|
||||
pathToHow: 'how_digital_ocean',
|
||||
pathToHow: 'how_digital_ocean_dns',
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
@ -130,9 +130,7 @@ class InitializingPage extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
if (cubit.state is ServerInstallationEmpty ||
|
||||
cubit.state is ServerInstallationNotFinished &&
|
||||
cubit.state.progress ==
|
||||
ServerSetupProgress.nothingYet)
|
||||
cubit.state is ServerInstallationNotFinished)
|
||||
Container(
|
||||
alignment: Alignment.center,
|
||||
child: BrandButton.filled(
|
||||
|
|
|
@ -120,14 +120,6 @@ class SelectLocationPage extends StatelessWidget {
|
|||
.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
location.countryDisplayKey.tr(),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium,
|
||||
),
|
||||
if (location.description != null)
|
||||
const SizedBox(height: 4),
|
||||
if (location.description != null)
|
||||
Text(
|
||||
location.description!,
|
||||
|
|
|
@ -38,7 +38,7 @@ class NewUserPage extends StatelessWidget {
|
|||
return BlocListener<UserFormCubit, FormCubitState>(
|
||||
listener: (final BuildContext context, final FormCubitState state) {
|
||||
if (state.isSubmitted) {
|
||||
context.router.maybePop();
|
||||
context.router.pop();
|
||||
}
|
||||
},
|
||||
child: BrandHeroScreen(
|
||||
|
|
|
@ -103,7 +103,7 @@ class _DeleteUserTile extends StatelessWidget {
|
|||
TextButton(
|
||||
child: Text('basis.cancel'.tr()),
|
||||
onPressed: () {
|
||||
context.router.maybePop();
|
||||
context.router.pop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
|
@ -115,8 +115,8 @@ class _DeleteUserTile extends StatelessWidget {
|
|||
),
|
||||
onPressed: () {
|
||||
context.read<JobsCubit>().addJob(DeleteUserJob(user: user));
|
||||
context.router.childControllers.first.maybePop();
|
||||
context.router.maybePop();
|
||||
context.router.childControllers.first.pop();
|
||||
context.router.pop();
|
||||
},
|
||||
),
|
||||
],
|
||||
|
@ -244,7 +244,7 @@ class _SshKeysCard extends StatelessWidget {
|
|||
publicKey: key,
|
||||
),
|
||||
);
|
||||
context.maybePop();
|
||||
context.popRoute();
|
||||
},
|
||||
),
|
||||
],
|
||||
|
|
444
pubspec.lock
444
pubspec.lock
File diff suppressed because it is too large
Load Diff
38
pubspec.yaml
38
pubspec.yaml
|
@ -5,29 +5,30 @@ version: 0.11.0+22
|
|||
|
||||
environment:
|
||||
sdk: '>=3.2.1 <4.0.0'
|
||||
flutter: ">=3.19.5"
|
||||
flutter: ">=3.16.1"
|
||||
|
||||
dependencies:
|
||||
animations: ^2.0.11
|
||||
auto_route: ^8.0.3
|
||||
animations: ^2.0.8
|
||||
auto_route: ^7.8.4
|
||||
auto_size_text: ^3.0.0
|
||||
bloc_concurrency: ^0.2.5
|
||||
bloc_concurrency: ^0.2.3
|
||||
crypt: ^4.3.1
|
||||
collection: ^1.18.0
|
||||
cubit_form: ^2.0.1
|
||||
device_info_plus: ^10.0.1
|
||||
dio: ^5.4.2+1
|
||||
device_info_plus: ^9.1.1
|
||||
dio: ^5.4.0
|
||||
duration: ^3.0.13
|
||||
dynamic_color: ^1.7.0
|
||||
easy_localization: ^3.0.5
|
||||
dynamic_color: ^1.6.8
|
||||
easy_localization: ^3.0.3
|
||||
either_option: ^2.0.1-dev.1
|
||||
equatable: ^2.0.5
|
||||
fl_chart: ^0.67.0
|
||||
fl_chart: ^0.65.0
|
||||
flutter:
|
||||
sdk: flutter
|
||||
flutter_bloc: ^8.1.5
|
||||
flutter_markdown: ^0.6.22
|
||||
flutter_bloc: ^8.1.3
|
||||
flutter_markdown: ^0.6.18+2
|
||||
flutter_secure_storage: ^9.0.0
|
||||
flutter_svg: ^2.0.10+1
|
||||
flutter_svg: ^2.0.9
|
||||
gap: ^3.0.1
|
||||
get_it: ^7.6.4
|
||||
gql: ^1.0.0
|
||||
|
@ -37,11 +38,12 @@ dependencies:
|
|||
hive: ^2.2.3
|
||||
hive_flutter: ^1.1.0
|
||||
http: ^1.1.2
|
||||
intl: ^0.18.1
|
||||
intl: ^0.18.0
|
||||
ionicons: ^0.2.2
|
||||
json_annotation: ^4.8.1
|
||||
material_color_utilities: ^0.8.0
|
||||
modal_bottom_sheet: ^3.0.0
|
||||
local_auth: ^2.1.7
|
||||
material_color_utilities: ^0.5.0
|
||||
modal_bottom_sheet: ^3.0.0-pre
|
||||
nanoid: ^1.0.0
|
||||
package_info: ^2.0.2
|
||||
pretty_dio_logger: ^1.3.1
|
||||
|
@ -53,14 +55,14 @@ dependencies:
|
|||
# wakelock: ^0.6.2
|
||||
|
||||
dev_dependencies:
|
||||
auto_route_generator: ^8.0.0
|
||||
auto_route_generator: ^7.3.2
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
build_runner: ^2.4.9
|
||||
build_runner: ^2.4.7
|
||||
flutter_launcher_icons: ^0.13.1
|
||||
hive_generator: ^2.0.1
|
||||
json_serializable: ^6.7.1
|
||||
flutter_lints: ^3.0.2
|
||||
flutter_lints: ^3.0.1
|
||||
|
||||
flutter_icons:
|
||||
android: "launcher_icon"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
|
||||
#include <dynamic_color/dynamic_color_plugin_c_api.h>
|
||||
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
|
||||
#include <local_auth_windows/local_auth_plugin.h>
|
||||
#include <url_launcher_windows/url_launcher_windows.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
|
@ -18,6 +19,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||
registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
|
||||
FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
|
||||
LocalAuthPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("LocalAuthPlugin"));
|
||||
UrlLauncherWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||
connectivity_plus
|
||||
dynamic_color
|
||||
flutter_secure_storage_windows
|
||||
local_auth_windows
|
||||
url_launcher_windows
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue