1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-09 23:17:29 +02:00

feat(web,server): external domain setting (#6146)

* feat: external domain setting

* chore: open api

* mobile: handle serverconfig-externalDomain

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
Jason Rasmussen
2024-01-03 21:54:48 -05:00
committed by GitHub
parent 1e503c3212
commit 317adc5c28
35 changed files with 433 additions and 23 deletions

View File

@@ -149,6 +149,7 @@ doc/SystemConfigNewVersionCheckDto.md
doc/SystemConfigOAuthDto.md
doc/SystemConfigPasswordLoginDto.md
doc/SystemConfigReverseGeocodingDto.md
doc/SystemConfigServerDto.md
doc/SystemConfigStorageTemplateDto.md
doc/SystemConfigTemplateStorageOptionDto.md
doc/SystemConfigThemeDto.md
@@ -335,6 +336,7 @@ lib/model/system_config_new_version_check_dto.dart
lib/model/system_config_o_auth_dto.dart
lib/model/system_config_password_login_dto.dart
lib/model/system_config_reverse_geocoding_dto.dart
lib/model/system_config_server_dto.dart
lib/model/system_config_storage_template_dto.dart
lib/model/system_config_template_storage_option_dto.dart
lib/model/system_config_theme_dto.dart
@@ -508,6 +510,7 @@ test/system_config_new_version_check_dto_test.dart
test/system_config_o_auth_dto_test.dart
test/system_config_password_login_dto_test.dart
test/system_config_reverse_geocoding_dto_test.dart
test/system_config_server_dto_test.dart
test/system_config_storage_template_dto_test.dart
test/system_config_template_storage_option_dto_test.dart
test/system_config_theme_dto_test.dart

View File

@@ -341,6 +341,7 @@ Class | Method | HTTP request | Description
- [SystemConfigOAuthDto](doc//SystemConfigOAuthDto.md)
- [SystemConfigPasswordLoginDto](doc//SystemConfigPasswordLoginDto.md)
- [SystemConfigReverseGeocodingDto](doc//SystemConfigReverseGeocodingDto.md)
- [SystemConfigServerDto](doc//SystemConfigServerDto.md)
- [SystemConfigStorageTemplateDto](doc//SystemConfigStorageTemplateDto.md)
- [SystemConfigTemplateStorageOptionDto](doc//SystemConfigTemplateStorageOptionDto.md)
- [SystemConfigThemeDto](doc//SystemConfigThemeDto.md)

View File

@@ -8,6 +8,7 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**externalDomain** | **String** | |
**isInitialized** | **bool** | |
**loginPageMessage** | **String** | |
**oauthButtonText** | **String** | |

View File

@@ -18,6 +18,7 @@ Name | Type | Description | Notes
**oauth** | [**SystemConfigOAuthDto**](SystemConfigOAuthDto.md) | |
**passwordLogin** | [**SystemConfigPasswordLoginDto**](SystemConfigPasswordLoginDto.md) | |
**reverseGeocoding** | [**SystemConfigReverseGeocodingDto**](SystemConfigReverseGeocodingDto.md) | |
**server** | [**SystemConfigServerDto**](SystemConfigServerDto.md) | |
**storageTemplate** | [**SystemConfigStorageTemplateDto**](SystemConfigStorageTemplateDto.md) | |
**theme** | [**SystemConfigThemeDto**](SystemConfigThemeDto.md) | |
**thumbnail** | [**SystemConfigThumbnailDto**](SystemConfigThumbnailDto.md) | |

View File

@@ -0,0 +1,15 @@
# openapi.model.SystemConfigServerDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**externalDomain** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -177,6 +177,7 @@ part 'model/system_config_new_version_check_dto.dart';
part 'model/system_config_o_auth_dto.dart';
part 'model/system_config_password_login_dto.dart';
part 'model/system_config_reverse_geocoding_dto.dart';
part 'model/system_config_server_dto.dart';
part 'model/system_config_storage_template_dto.dart';
part 'model/system_config_template_storage_option_dto.dart';
part 'model/system_config_theme_dto.dart';

View File

@@ -441,6 +441,8 @@ class ApiClient {
return SystemConfigPasswordLoginDto.fromJson(value);
case 'SystemConfigReverseGeocodingDto':
return SystemConfigReverseGeocodingDto.fromJson(value);
case 'SystemConfigServerDto':
return SystemConfigServerDto.fromJson(value);
case 'SystemConfigStorageTemplateDto':
return SystemConfigStorageTemplateDto.fromJson(value);
case 'SystemConfigTemplateStorageOptionDto':

View File

@@ -13,12 +13,15 @@ part of openapi.api;
class ServerConfigDto {
/// Returns a new [ServerConfigDto] instance.
ServerConfigDto({
required this.externalDomain,
required this.isInitialized,
required this.loginPageMessage,
required this.oauthButtonText,
required this.trashDays,
});
String externalDomain;
bool isInitialized;
String loginPageMessage;
@@ -29,6 +32,7 @@ class ServerConfigDto {
@override
bool operator ==(Object other) => identical(this, other) || other is ServerConfigDto &&
other.externalDomain == externalDomain &&
other.isInitialized == isInitialized &&
other.loginPageMessage == loginPageMessage &&
other.oauthButtonText == oauthButtonText &&
@@ -37,16 +41,18 @@ class ServerConfigDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(externalDomain.hashCode) +
(isInitialized.hashCode) +
(loginPageMessage.hashCode) +
(oauthButtonText.hashCode) +
(trashDays.hashCode);
@override
String toString() => 'ServerConfigDto[isInitialized=$isInitialized, loginPageMessage=$loginPageMessage, oauthButtonText=$oauthButtonText, trashDays=$trashDays]';
String toString() => 'ServerConfigDto[externalDomain=$externalDomain, isInitialized=$isInitialized, loginPageMessage=$loginPageMessage, oauthButtonText=$oauthButtonText, trashDays=$trashDays]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'externalDomain'] = this.externalDomain;
json[r'isInitialized'] = this.isInitialized;
json[r'loginPageMessage'] = this.loginPageMessage;
json[r'oauthButtonText'] = this.oauthButtonText;
@@ -62,6 +68,7 @@ class ServerConfigDto {
final json = value.cast<String, dynamic>();
return ServerConfigDto(
externalDomain: mapValueOfType<String>(json, r'externalDomain')!,
isInitialized: mapValueOfType<bool>(json, r'isInitialized')!,
loginPageMessage: mapValueOfType<String>(json, r'loginPageMessage')!,
oauthButtonText: mapValueOfType<String>(json, r'oauthButtonText')!,
@@ -113,6 +120,7 @@ class ServerConfigDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'externalDomain',
'isInitialized',
'loginPageMessage',
'oauthButtonText',

View File

@@ -23,6 +23,7 @@ class SystemConfigDto {
required this.oauth,
required this.passwordLogin,
required this.reverseGeocoding,
required this.server,
required this.storageTemplate,
required this.theme,
required this.thumbnail,
@@ -49,6 +50,8 @@ class SystemConfigDto {
SystemConfigReverseGeocodingDto reverseGeocoding;
SystemConfigServerDto server;
SystemConfigStorageTemplateDto storageTemplate;
SystemConfigThemeDto theme;
@@ -69,6 +72,7 @@ class SystemConfigDto {
other.oauth == oauth &&
other.passwordLogin == passwordLogin &&
other.reverseGeocoding == reverseGeocoding &&
other.server == server &&
other.storageTemplate == storageTemplate &&
other.theme == theme &&
other.thumbnail == thumbnail &&
@@ -87,13 +91,14 @@ class SystemConfigDto {
(oauth.hashCode) +
(passwordLogin.hashCode) +
(reverseGeocoding.hashCode) +
(server.hashCode) +
(storageTemplate.hashCode) +
(theme.hashCode) +
(thumbnail.hashCode) +
(trash.hashCode);
@override
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, newVersionCheck=$newVersionCheck, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, storageTemplate=$storageTemplate, theme=$theme, thumbnail=$thumbnail, trash=$trash]';
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, job=$job, library_=$library_, logging=$logging, machineLearning=$machineLearning, map=$map, newVersionCheck=$newVersionCheck, oauth=$oauth, passwordLogin=$passwordLogin, reverseGeocoding=$reverseGeocoding, server=$server, storageTemplate=$storageTemplate, theme=$theme, thumbnail=$thumbnail, trash=$trash]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@@ -107,6 +112,7 @@ class SystemConfigDto {
json[r'oauth'] = this.oauth;
json[r'passwordLogin'] = this.passwordLogin;
json[r'reverseGeocoding'] = this.reverseGeocoding;
json[r'server'] = this.server;
json[r'storageTemplate'] = this.storageTemplate;
json[r'theme'] = this.theme;
json[r'thumbnail'] = this.thumbnail;
@@ -132,6 +138,7 @@ class SystemConfigDto {
oauth: SystemConfigOAuthDto.fromJson(json[r'oauth'])!,
passwordLogin: SystemConfigPasswordLoginDto.fromJson(json[r'passwordLogin'])!,
reverseGeocoding: SystemConfigReverseGeocodingDto.fromJson(json[r'reverseGeocoding'])!,
server: SystemConfigServerDto.fromJson(json[r'server'])!,
storageTemplate: SystemConfigStorageTemplateDto.fromJson(json[r'storageTemplate'])!,
theme: SystemConfigThemeDto.fromJson(json[r'theme'])!,
thumbnail: SystemConfigThumbnailDto.fromJson(json[r'thumbnail'])!,
@@ -193,6 +200,7 @@ class SystemConfigDto {
'oauth',
'passwordLogin',
'reverseGeocoding',
'server',
'storageTemplate',
'theme',
'thumbnail',

View File

@@ -0,0 +1,98 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SystemConfigServerDto {
/// Returns a new [SystemConfigServerDto] instance.
SystemConfigServerDto({
required this.externalDomain,
});
String externalDomain;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigServerDto &&
other.externalDomain == externalDomain;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(externalDomain.hashCode);
@override
String toString() => 'SystemConfigServerDto[externalDomain=$externalDomain]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'externalDomain'] = this.externalDomain;
return json;
}
/// Returns a new [SystemConfigServerDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SystemConfigServerDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return SystemConfigServerDto(
externalDomain: mapValueOfType<String>(json, r'externalDomain')!,
);
}
return null;
}
static List<SystemConfigServerDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigServerDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigServerDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, SystemConfigServerDto> mapFromJson(dynamic json) {
final map = <String, SystemConfigServerDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigServerDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of SystemConfigServerDto-objects as value to a dart map
static Map<String, List<SystemConfigServerDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SystemConfigServerDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = SystemConfigServerDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'externalDomain',
};
}

View File

@@ -16,6 +16,11 @@ void main() {
// final instance = ServerConfigDto();
group('test ServerConfigDto', () {
// String externalDomain
test('to test the property `externalDomain`', () async {
// TODO
});
// bool isInitialized
test('to test the property `isInitialized`', () async {
// TODO

View File

@@ -66,6 +66,11 @@ void main() {
// TODO
});
// SystemConfigServerDto server
test('to test the property `server`', () async {
// TODO
});
// SystemConfigStorageTemplateDto storageTemplate
test('to test the property `storageTemplate`', () async {
// TODO

View File

@@ -0,0 +1,27 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
import 'package:openapi/api.dart';
import 'package:test/test.dart';
// tests for SystemConfigServerDto
void main() {
// final instance = SystemConfigServerDto();
group('test SystemConfigServerDto', () {
// String externalDomain
test('to test the property `externalDomain`', () async {
// TODO
});
});
}