aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/settings/+page.svelte154
1 files changed, 80 insertions, 74 deletions
diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelte
index 4b0cb91b..f45fa5cd 100644
--- a/src/routes/settings/+page.svelte
+++ b/src/routes/settings/+page.svelte
@@ -68,80 +68,86 @@
{#if data.user === undefined}
<LogInRestricted />
{:else}
- {#if !$settings.settingsSync}
- <button
- on:click={() => {
- $settings.settingsSync = true;
-
- fetch(root(`/api/configuration?id=${$identity.id}`)).then((response) => {
- if (response.ok) {
- response.json().then((data) => {
- if (data && data.configuration) {
- $settings = data.configuration;
-
- addNotification(
- options({
- heading: 'Pulled remote configuration'
- })
- );
- } else {
- fetch(root(`/api/configuration`), {
- method: 'PUT',
- body: JSON.stringify($settings)
- }).then((response) => {
- if (response.ok)
- addNotification(
- options({
- heading: 'Created remote configuration'
- })
- );
- });
- }
- });
- }
- });
- }}
- >
- Enable Settings Sync &amp; Pull Remote Configuration
- </button>
- <button
- on:click={() => {
- $settings.settingsSync = true;
-
- fetch(root(`/api/configuration`), {
- method: 'PUT',
- body: JSON.stringify($settings)
- }).then((response) => {
- if (response.ok)
- addNotification(
- options({
- heading: 'Settings Sync',
- description: 'Pushed local configuration to remote'
- })
- );
- });
- }}
- >
- Enable &amp; Push Local Configuration
- </button>
- {:else}
- <button
- on:click={() => {
- $settings.settingsSync = false;
-
- addNotification(
- options({
- heading: 'Settings sync disabled'
- })
- );
- }}
- >
- Disable Settings Sync &amp; Keep Local Configuration
- </button>
- {/if}
-
- <p />
-
+ <Category title={$locale().settings.settingsSync.title} id="sync" open={false}>
+ {#if !$settings.settingsSync}
+ <button
+ on:click={() => {
+ $settings.settingsSync = true;
+
+ fetch(root(`/api/configuration?id=${$identity.id}`)).then((response) => {
+ if (response.ok) {
+ response.json().then((data) => {
+ if (data && data.configuration) {
+ $settings = data.configuration;
+
+ addNotification(
+ options({
+ heading: 'Pulled remote configuration'
+ })
+ );
+ } else {
+ fetch(root(`/api/configuration`), {
+ method: 'PUT',
+ body: JSON.stringify($settings)
+ }).then((response) => {
+ if (response.ok)
+ addNotification(
+ options({
+ heading: 'Created remote configuration'
+ })
+ );
+ });
+ }
+ });
+ }
+ });
+ }}
+ >
+ Pull Remote Configuration
+ </button>
+ <SettingHint lineBreak>
+ Enable settings sync and overwrite any local settings with your remote configuration
+ </SettingHint>
+ <p />
+ <button
+ on:click={() => {
+ $settings.settingsSync = true;
+
+ fetch(root(`/api/configuration`), {
+ method: 'PUT',
+ body: JSON.stringify($settings)
+ }).then((response) => {
+ if (response.ok)
+ addNotification(
+ options({
+ heading: 'Settings Sync',
+ description: 'Pushed local configuration to remote'
+ })
+ );
+ });
+ }}
+ >
+ Push Local Configuration
+ </button>
+ <SettingHint lineBreak>
+ Enable settings sync and overwrite any remote configuration with your local settings
+ </SettingHint>
+ {:else}
+ <button
+ on:click={() => {
+ $settings.settingsSync = false;
+
+ addNotification(
+ options({
+ heading: 'Settings sync disabled'
+ })
+ );
+ }}
+ >
+ Disable &amp; Keep Local Configuration
+ </button>
+ {/if}
+ </Category>
<Category title={$locale().settings.rssFeeds.title} id="feeds">
<button
on:click={() => {