mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(web): improved server stats (#1870)
* feat(web): improved server stats * fix(web): don't log unauthorized errors * Revert "fix(web): don't log unauthorized errors" This reverts commit 7fc2987a77ae8bf3a7381ed3156a7a0c16f27564.
This commit is contained in:
@@ -13,11 +13,9 @@ part of openapi.api;
|
||||
class ServerStatsResponseDto {
|
||||
/// Returns a new [ServerStatsResponseDto] instance.
|
||||
ServerStatsResponseDto({
|
||||
required this.photos,
|
||||
required this.videos,
|
||||
required this.objects,
|
||||
required this.usageRaw,
|
||||
required this.usage,
|
||||
this.photos = 0,
|
||||
this.videos = 0,
|
||||
this.usage = 0,
|
||||
this.usageByUser = const [],
|
||||
});
|
||||
|
||||
@@ -25,11 +23,7 @@ class ServerStatsResponseDto {
|
||||
|
||||
int videos;
|
||||
|
||||
int objects;
|
||||
|
||||
int usageRaw;
|
||||
|
||||
String usage;
|
||||
int usage;
|
||||
|
||||
List<UsageByUserDto> usageByUser;
|
||||
|
||||
@@ -37,8 +31,6 @@ class ServerStatsResponseDto {
|
||||
bool operator ==(Object other) => identical(this, other) || other is ServerStatsResponseDto &&
|
||||
other.photos == photos &&
|
||||
other.videos == videos &&
|
||||
other.objects == objects &&
|
||||
other.usageRaw == usageRaw &&
|
||||
other.usage == usage &&
|
||||
other.usageByUser == usageByUser;
|
||||
|
||||
@@ -47,20 +39,16 @@ class ServerStatsResponseDto {
|
||||
// ignore: unnecessary_parenthesis
|
||||
(photos.hashCode) +
|
||||
(videos.hashCode) +
|
||||
(objects.hashCode) +
|
||||
(usageRaw.hashCode) +
|
||||
(usage.hashCode) +
|
||||
(usageByUser.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ServerStatsResponseDto[photos=$photos, videos=$videos, objects=$objects, usageRaw=$usageRaw, usage=$usage, usageByUser=$usageByUser]';
|
||||
String toString() => 'ServerStatsResponseDto[photos=$photos, videos=$videos, usage=$usage, usageByUser=$usageByUser]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'photos'] = this.photos;
|
||||
json[r'videos'] = this.videos;
|
||||
json[r'objects'] = this.objects;
|
||||
json[r'usageRaw'] = this.usageRaw;
|
||||
json[r'usage'] = this.usage;
|
||||
json[r'usageByUser'] = this.usageByUser;
|
||||
return json;
|
||||
@@ -87,9 +75,7 @@ class ServerStatsResponseDto {
|
||||
return ServerStatsResponseDto(
|
||||
photos: mapValueOfType<int>(json, r'photos')!,
|
||||
videos: mapValueOfType<int>(json, r'videos')!,
|
||||
objects: mapValueOfType<int>(json, r'objects')!,
|
||||
usageRaw: mapValueOfType<int>(json, r'usageRaw')!,
|
||||
usage: mapValueOfType<String>(json, r'usage')!,
|
||||
usage: mapValueOfType<int>(json, r'usage')!,
|
||||
usageByUser: UsageByUserDto.listFromJson(json[r'usageByUser'])!,
|
||||
);
|
||||
}
|
||||
@@ -142,8 +128,6 @@ class ServerStatsResponseDto {
|
||||
static const requiredKeys = <String>{
|
||||
'photos',
|
||||
'videos',
|
||||
'objects',
|
||||
'usageRaw',
|
||||
'usage',
|
||||
'usageByUser',
|
||||
};
|
||||
|
||||
42
mobile/openapi/lib/model/usage_by_user_dto.dart
generated
42
mobile/openapi/lib/model/usage_by_user_dto.dart
generated
@@ -14,48 +14,54 @@ class UsageByUserDto {
|
||||
/// Returns a new [UsageByUserDto] instance.
|
||||
UsageByUserDto({
|
||||
required this.userId,
|
||||
required this.videos,
|
||||
required this.userFirstName,
|
||||
required this.userLastName,
|
||||
required this.photos,
|
||||
required this.usageRaw,
|
||||
required this.videos,
|
||||
required this.usage,
|
||||
});
|
||||
|
||||
String userId;
|
||||
|
||||
int videos;
|
||||
String userFirstName;
|
||||
|
||||
String userLastName;
|
||||
|
||||
int photos;
|
||||
|
||||
int usageRaw;
|
||||
int videos;
|
||||
|
||||
String usage;
|
||||
int usage;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UsageByUserDto &&
|
||||
other.userId == userId &&
|
||||
other.videos == videos &&
|
||||
other.userFirstName == userFirstName &&
|
||||
other.userLastName == userLastName &&
|
||||
other.photos == photos &&
|
||||
other.usageRaw == usageRaw &&
|
||||
other.videos == videos &&
|
||||
other.usage == usage;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(userId.hashCode) +
|
||||
(videos.hashCode) +
|
||||
(userFirstName.hashCode) +
|
||||
(userLastName.hashCode) +
|
||||
(photos.hashCode) +
|
||||
(usageRaw.hashCode) +
|
||||
(videos.hashCode) +
|
||||
(usage.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UsageByUserDto[userId=$userId, videos=$videos, photos=$photos, usageRaw=$usageRaw, usage=$usage]';
|
||||
String toString() => 'UsageByUserDto[userId=$userId, userFirstName=$userFirstName, userLastName=$userLastName, photos=$photos, videos=$videos, usage=$usage]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'userId'] = this.userId;
|
||||
json[r'videos'] = this.videos;
|
||||
json[r'userFirstName'] = this.userFirstName;
|
||||
json[r'userLastName'] = this.userLastName;
|
||||
json[r'photos'] = this.photos;
|
||||
json[r'usageRaw'] = this.usageRaw;
|
||||
json[r'videos'] = this.videos;
|
||||
json[r'usage'] = this.usage;
|
||||
return json;
|
||||
}
|
||||
@@ -80,10 +86,11 @@ class UsageByUserDto {
|
||||
|
||||
return UsageByUserDto(
|
||||
userId: mapValueOfType<String>(json, r'userId')!,
|
||||
videos: mapValueOfType<int>(json, r'videos')!,
|
||||
userFirstName: mapValueOfType<String>(json, r'userFirstName')!,
|
||||
userLastName: mapValueOfType<String>(json, r'userLastName')!,
|
||||
photos: mapValueOfType<int>(json, r'photos')!,
|
||||
usageRaw: mapValueOfType<int>(json, r'usageRaw')!,
|
||||
usage: mapValueOfType<String>(json, r'usage')!,
|
||||
videos: mapValueOfType<int>(json, r'videos')!,
|
||||
usage: mapValueOfType<int>(json, r'usage')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -134,9 +141,10 @@ class UsageByUserDto {
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'userId',
|
||||
'videos',
|
||||
'userFirstName',
|
||||
'userLastName',
|
||||
'photos',
|
||||
'usageRaw',
|
||||
'videos',
|
||||
'usage',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user