diff --git a/web/src/lib/components/admin-page/jobs/storage-migration-description.svelte b/web/src/lib/components/admin-page/jobs/storage-migration-description.svelte index d840065954..550a907c43 100644 --- a/web/src/lib/components/admin-page/jobs/storage-migration-description.svelte +++ b/web/src/lib/components/admin-page/jobs/storage-migration-description.svelte @@ -3,7 +3,7 @@ Apply the current -Storage template to previously uploaded assets diff --git a/web/src/lib/components/admin-page/settings/admin-settings.svelte b/web/src/lib/components/admin-page/settings/admin-settings.svelte new file mode 100644 index 0000000000..d5fe2b6993 --- /dev/null +++ b/web/src/lib/components/admin-page/settings/admin-settings.svelte @@ -0,0 +1,75 @@ + + + + +{#if savedConfig && defaultConfig} + +{/if} diff --git a/web/src/lib/components/admin-page/settings/admin-settings.ts b/web/src/lib/components/admin-page/settings/admin-settings.ts new file mode 100644 index 0000000000..3330cfa466 --- /dev/null +++ b/web/src/lib/components/admin-page/settings/admin-settings.ts @@ -0,0 +1,7 @@ +import type { ResetOptions } from '$lib/utils/dipatch'; +import type { SystemConfigDto } from '@api'; + +export type SettingsEventType = { + reset: ResetOptions & { configKeys: Array }; + save: Partial; +}; diff --git a/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte b/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte index a4b55dccb1..b170dc5ae3 100644 --- a/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte +++ b/web/src/lib/components/admin-page/settings/ffmpeg/ffmpeg-settings.svelte @@ -1,13 +1,8 @@
- {#await getConfigs() then} -
-
-
-

- - To learn more about the terminology used here, refer to FFmpeg documentation for - H.264 codec, - HEVC codec - and - VP9 codec. -

- - - - - - - - - - - - - - - - - - - - - - + +
+

+ + To learn more about the terminology used here, refer to FFmpeg documentation for + H.264 codec, + HEVC codec -

- + and + VP9 codec. +

- + - -
- + - -
- + - + - + - -
-
-
+ -
- handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> -
- -
- {/await} + + + + + + + + + +
+ + + + + +
+
+ + +
+ + + + + + + +
+
+
+ +
+ dispatch('reset', { ...detail, configKeys: ['ffmpeg'] })} + on:save={() => dispatch('save', { ffmpeg: config.ffmpeg })} + showResetToDefault={!isEqual(savedConfig.ffmpeg, defaultConfig)} + {disabled} + /> +
+ +
diff --git a/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte b/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte index c9ba2f88c5..71516ab069 100644 --- a/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte +++ b/web/src/lib/components/admin-page/settings/job-settings/job-settings.svelte @@ -1,21 +1,18 @@
- {#await getConfigs() then} -
-
- {#each jobNames as jobName} -
- -
- {/each} - -
- handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} +
+ + {#each jobNames as jobName} +
+
- -
- {/await} + {/each} + +
+ dispatch('reset', { ...detail, configKeys: ['job'] })} + on:save={() => dispatch('save', { job: config.job })} + showResetToDefault={!isEqual(savedConfig.job, defaultConfig.job)} + {disabled} + /> +
+ +
diff --git a/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte b/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte index 46901b0011..505bc7088a 100644 --- a/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte +++ b/web/src/lib/components/admin-page/settings/library-settings/library-settings.svelte @@ -1,19 +1,17 @@
- {#await getConfigs() then} -
- -
-
- +
+ + +
+ -
- - -
- - + +
-
- handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> -
- -
-
- {/await} + + +

+ Set the scanning interval using the cron format. For more information please refer to e.g. Crontab Guru +

+
+
+
+ +
+ dispatch('reset', { ...detail, configKeys: ['library'] })} + on:save={() => dispatch('save', { library: config.library })} + showResetToDefault={!isEqual(savedConfig.library, defaultConfig.library)} + {disabled} + /> +
+ +
+
diff --git a/web/src/lib/components/admin-page/settings/logging-settings/logging-settings.svelte b/web/src/lib/components/admin-page/settings/logging-settings/logging-settings.svelte index 9884cb8380..022048927d 100644 --- a/web/src/lib/components/admin-page/settings/logging-settings/logging-settings.svelte +++ b/web/src/lib/components/admin-page/settings/logging-settings/logging-settings.svelte @@ -1,118 +1,50 @@
- {#await getConfigs() then} -
-
-
-
- -
+
+ +
+ + -
- - - handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> -
-
- -
- {/await} + dispatch('reset', { ...detail, configKeys: ['logging'] })} + on:save={() => dispatch('save', { logging: config.logging })} + showResetToDefault={!isEqual(savedConfig.logging, defaultConfig.logging)} + {disabled} + /> +
+ +
diff --git a/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte b/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte index c70232911c..2ad7b953e1 100644 --- a/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte +++ b/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte @@ -1,10 +1,5 @@
- {#await refreshConfig() then} -
-
-
+
+ +
+ + +
+ + +
+ + +

+

+ The name of a CLIP model listed here. Note that you + must re-run the 'Encode CLIP' job for all images upon changing a model. +

+
+
+
+ + +
+ + +
+ + + + + + + +
+
- -
- - -
- - -

- The name of a CLIP model listed here. Note that - you must re-run the 'Encode CLIP' job for all images upon changing a model. -

-
-
-
- - -
- - -
- - - - - - - - -
-
- - handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> - -
- {/await} + dispatch('reset', { ...detail, configKeys: ['machineLearning'] })} + on:save={() => dispatch('save', { machineLearning: config.machineLearning })} + showResetToDefault={!isEqual(savedConfig.machineLearning, defaultConfig.machineLearning)} + {disabled} + /> + +
diff --git a/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte b/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte index 0375dab0b7..63be4601bc 100644 --- a/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte +++ b/web/src/lib/components/admin-page/settings/map-settings/map-settings.svelte @@ -1,157 +1,87 @@
- {#await refreshConfig() then} -
-
-
- -
- +
+ +
+ +
+ -
+
- - -
+ + +
- - -

- Manage Reverse Geocoding settings -

-
-
- -
+ + +

+ Manage Reverse Geocoding settings +

+
+
+ +
- handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual( - { ...savedConfig.map, ...savedConfig.reverseGeocoding }, - { ...defaultConfig.map, ...defaultConfig.reverseGeocoding }, - )} - {disabled} - /> -
- -
- {/await} + dispatch('reset', { ...detail, configKeys: ['map', 'reverseGeocoding'] })} + on:save={() => dispatch('save', { map: config.map, reverseGeocoding: config.reverseGeocoding })} + showResetToDefault={!isEqual( + { map: savedConfig.map, reverseGeocoding: savedConfig.reverseGeocoding }, + { map: defaultConfig.map, reverseGeocoding: defaultConfig.reverseGeocoding }, + )} + {disabled} + /> +
+ +
diff --git a/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte b/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte index 6fbfa014a1..dafa14f67e 100644 --- a/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte +++ b/web/src/lib/components/admin-page/settings/new-version-check-settings/new-version-check-settings.svelte @@ -1,103 +1,37 @@
- {#await getConfigs() then} -
-
-
-
- - handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> -
-
-
-
- {/await} +
+
+
+ + dispatch('reset', { ...detail, configKeys: ['newVersionCheck'] })} + on:save={() => dispatch('save', { newVersionCheck: config.newVersionCheck })} + showResetToDefault={!isEqual(savedConfig, defaultConfig)} + {disabled} + /> +
+
+
diff --git a/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte b/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte index 098acc0146..e5842f4a29 100644 --- a/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte +++ b/web/src/lib/components/admin-page/settings/oauth/oauth-settings.svelte @@ -1,59 +1,29 @@ {#if isConfirmOpen} @@ -115,115 +58,113 @@ {/if}
- {#await getConfigs() then} -
-
-

- For more details about this feature, refer to the docs. -

+
+ +

+ For more details about this feature, refer to the docs. +

- -
+ +
+ + + + + + + + + + + + + + + + + handleToggleOverride()} + bind:checked={config.oauth.mobileOverrideEnabled} + /> + + {#if config.oauth.mobileOverrideEnabled} + {/if} - - - - - - - - - - - - - - - handleToggleOverride()} - bind:checked={oauthConfig.mobileOverrideEnabled} - /> - - {#if oauthConfig.mobileOverrideEnabled} - - {/if} - - handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> - -
- {/await} + dispatch('reset', { ...detail, configKeys: ['oauth'] })} + on:save={() => handleSave()} + showResetToDefault={!isEqual(savedConfig.oauth, defaultConfig.oauth)} + {disabled} + /> + +
diff --git a/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte b/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte index ec8a748fc2..445fc2ba03 100644 --- a/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte +++ b/web/src/lib/components/admin-page/settings/password-login/password-login-settings.svelte @@ -1,37 +1,19 @@ @@ -103,27 +45,23 @@ {/if}
- {#await getConfigs() then} -
-
-
-
- +
+ +
+ - handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> -
-
- -
- {/await} + dispatch('reset', { ...detail, configKeys: ['passwordLogin'] })} + on:save={() => handleSave()} + showResetToDefault={!isEqual(savedConfig.passwordLogin, defaultConfig.passwordLogin)} + {disabled} + /> +
+ +
diff --git a/web/src/lib/components/admin-page/settings/server/server-settings.svelte b/web/src/lib/components/admin-page/settings/server/server-settings.svelte index c951bb940c..09f53ca976 100644 --- a/web/src/lib/components/admin-page/settings/server/server-settings.svelte +++ b/web/src/lib/components/admin-page/settings/server/server-settings.svelte @@ -1,116 +1,49 @@
- {#await getConfigs() then} -
-
-
- +
+ +
+ - + -
- handleReset(detail)} - on:save={saveSetting} - showResetToDefault={!isEqual(savedConfig, defaultConfig)} - {disabled} - /> -
+
+ dispatch('reset', { ...detail, configKeys: ['server'] })} + on:save={() => dispatch('save', { server: config.server })} + showResetToDefault={!isEqual(savedConfig, defaultConfig)} + {disabled} + />
- -
- {/await} +
+ +
diff --git a/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte b/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte index a0ac0dbf01..66f8564cf3 100644 --- a/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte +++ b/web/src/lib/components/admin-page/settings/storage-template/storage-template-settings.svelte @@ -1,5 +1,5 @@
- {#await getConfigs() then} -
+ {#await getTemplateOptions() then} +
{#if !minified} @@ -178,12 +96,14 @@ title="HASH VERIFICATION ENABLED" {disabled} subtitle="Enables hash verification, don't disable this unless you're certain of the implications" - bind:checked={storageConfig.hashVerificationEnabled} - isEdited={!(storageConfig.hashVerificationEnabled === savedConfig.hashVerificationEnabled)} + bind:checked={config.storageTemplate.hashVerificationEnabled} + isEdited={!( + config.storageTemplate.hashVerificationEnabled === savedConfig.storageTemplate.hashVerificationEnabled + )} /> {/if} - {#if storageConfig.enabled} + {#if config.storageTemplate.enabled}

Variables

@@ -232,7 +152,7 @@