diff --git a/frontend/src/lib/assets/google_maps.svg b/frontend/src/lib/assets/google_maps.svg new file mode 100644 index 0000000..9c0f945 --- /dev/null +++ b/frontend/src/lib/assets/google_maps.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 0d66669..af4d624 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -704,6 +704,9 @@ "copy_locally_desc": "Copy images to the server for offline access. Uses more disk space.", "error_saving_image": "Error saving image" }, + "google_maps": { + "google_maps_integration_desc": "Connect your Google Maps account to get high-quality location search results and recommendations." + }, "recomendations": { "address": "Address", "phone": "Phone", diff --git a/frontend/src/routes/settings/+page.server.ts b/frontend/src/routes/settings/+page.server.ts index 0d6bd26..1ef6b13 100644 --- a/frontend/src/routes/settings/+page.server.ts +++ b/frontend/src/routes/settings/+page.server.ts @@ -70,6 +70,17 @@ export const load: PageServerLoad = async (event) => { }); let socialProviders = await socialProvidersFetch.json(); + let integrationsFetch = await fetch(`${endpoint}/api/integrations/`, { + headers: { + Cookie: `sessionid=${sessionId}` + } + }); + if (!integrationsFetch.ok) { + return redirect(302, '/'); + } + let integrations = await integrationsFetch.json(); + let googleMapsEnabled = integrations.google_maps as boolean; + let publicUrlFetch = await fetch(`${endpoint}/public-url/`); let publicUrl = ''; if (!publicUrlFetch.ok) { @@ -86,7 +97,8 @@ export const load: PageServerLoad = async (event) => { authenticators, immichIntegration, publicUrl, - socialProviders + socialProviders, + googleMapsEnabled } }; }; diff --git a/frontend/src/routes/settings/+page.svelte b/frontend/src/routes/settings/+page.svelte index 665ec2a..06a2903 100644 --- a/frontend/src/routes/settings/+page.svelte +++ b/frontend/src/routes/settings/+page.svelte @@ -9,6 +9,7 @@ import TotpModal from '$lib/components/TOTPModal.svelte'; import { appTitle, appVersion, copyrightYear } from '$lib/config.js'; import ImmichLogo from '$lib/assets/immich.svg'; + import GoogleMapsLogo from '$lib/assets/google_maps.svg'; export let data; console.log(data); @@ -23,6 +24,7 @@ let new_email: string = ''; let public_url: string = data.props.publicUrl; let immichIntegration = data.props.immichIntegration; + let googleMapsEnabled = data.props.googleMapsEnabled; let activeSection: string = 'profile'; let newImmichIntegration: ImmichIntegration = { @@ -762,11 +764,11 @@ -
{$t('immich.immich_integration_desc')}
@@ -873,6 +875,34 @@+ {$t('google_maps.google_maps_integration_desc')} +
++ 📖 {$t('immich.need_help')} + {$t('navbar.documentation')} +
+