mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
parent
fcc3b81745
commit
25c9b779e4
6 changed files with 13 additions and 2 deletions
BIN
mobile/openapi/doc/SystemConfigApi.md
generated
BIN
mobile/openapi/doc/SystemConfigApi.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/system_config_api.dart
generated
BIN
mobile/openapi/lib/api/system_config_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/system_config_api_test.dart
generated
BIN
mobile/openapi/test/system_config_api_test.dart
generated
Binary file not shown.
|
@ -5348,6 +5348,14 @@
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "getMapStyle",
|
"operationId": "getMapStyle",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "key",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "theme",
|
"name": "theme",
|
||||||
"required": true,
|
"required": true,
|
||||||
|
|
|
@ -2422,13 +2422,15 @@ export function getConfigDefaults(opts?: Oazapfts.RequestOpts) {
|
||||||
...opts
|
...opts
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
export function getMapStyle({ theme }: {
|
export function getMapStyle({ key, theme }: {
|
||||||
|
key?: string;
|
||||||
theme: MapTheme;
|
theme: MapTheme;
|
||||||
}, opts?: Oazapfts.RequestOpts) {
|
}, opts?: Oazapfts.RequestOpts) {
|
||||||
return oazapfts.ok(oazapfts.fetchJson<{
|
return oazapfts.ok(oazapfts.fetchJson<{
|
||||||
status: 200;
|
status: 200;
|
||||||
data: object;
|
data: object;
|
||||||
}>(`/system-config/map/style.json${QS.query(QS.explode({
|
}>(`/system-config/map/style.json${QS.query(QS.explode({
|
||||||
|
key,
|
||||||
theme
|
theme
|
||||||
}))}`, {
|
}))}`, {
|
||||||
...opts
|
...opts
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
import Icon from '$lib/components/elements/icon.svelte';
|
||||||
import { Theme } from '$lib/constants';
|
import { Theme } from '$lib/constants';
|
||||||
import { colorTheme, mapSettings } from '$lib/stores/preferences.store';
|
import { colorTheme, mapSettings } from '$lib/stores/preferences.store';
|
||||||
import { getAssetThumbnailUrl, handlePromiseError } from '$lib/utils';
|
import { getAssetThumbnailUrl, getKey, handlePromiseError } from '$lib/utils';
|
||||||
import { getMapStyle, MapTheme, type MapMarkerResponseDto } from '@immich/sdk';
|
import { getMapStyle, MapTheme, type MapMarkerResponseDto } from '@immich/sdk';
|
||||||
import { mdiCog, mdiMapMarker } from '@mdi/js';
|
import { mdiCog, mdiMapMarker } from '@mdi/js';
|
||||||
import type { Feature, GeoJsonProperties, Geometry, Point } from 'geojson';
|
import type { Feature, GeoJsonProperties, Geometry, Point } from 'geojson';
|
||||||
|
@ -50,6 +50,7 @@
|
||||||
$: style = (() =>
|
$: style = (() =>
|
||||||
getMapStyle({
|
getMapStyle({
|
||||||
theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme,
|
theme: ($mapSettings.allowDarkMode ? $colorTheme.value : Theme.LIGHT) as unknown as MapTheme,
|
||||||
|
key: getKey(),
|
||||||
}) as Promise<StyleSpecification>)();
|
}) as Promise<StyleSpecification>)();
|
||||||
|
|
||||||
const dispatch = createEventDispatcher<{
|
const dispatch = createEventDispatcher<{
|
||||||
|
|
Loading…
Reference in a new issue