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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 433 additions and 23 deletions

View file

@ -9,6 +9,7 @@ import 'package:immich_mobile/modules/search/ui/thumbnail_with_info.dart';
import 'package:immich_mobile/modules/shared_link/models/shared_link.dart';
import 'package:immich_mobile/modules/shared_link/providers/shared_link.provider.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/shared/providers/server_info.provider.dart';
import 'package:immich_mobile/shared/ui/confirm_dialog.dart';
import 'package:immich_mobile/shared/ui/immich_toast.dart';
import 'package:immich_mobile/utils/image_url_builder.dart';
@ -71,7 +72,11 @@ class SharedLinkItem extends ConsumerWidget {
final imageSize = math.min(context.width / 4, 100.0);
void copyShareLinkToClipboard() {
final serverUrl = getServerUrl();
final externalDomain = ref.read(
serverInfoProvider.select((s) => s.serverConfig.externalDomain),
);
final serverUrl =
externalDomain.isNotEmpty ? externalDomain : getServerUrl();
if (serverUrl == null) {
ImmichToast.show(
context: context,