{#if !$settings.settingsSync} { $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' }) ); }); } }); } }); }} > {$locale().settings.settingsSync.buttons.pull.title} {$locale().settings.settingsSync.buttons.pull.hint} { $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' }) ); }); }} > {$locale().settings.settingsSync.buttons.push.title} {$locale().settings.settingsSync.buttons.push.hint} {:else} { $settings.settingsSync = false; addNotification( options({ heading: 'Settings sync disabled' }) ); }} > {$locale().settings.settingsSync.buttons.disable} { fetch(root(`/api/configuration?id=${$identity.id}`), { method: 'DELETE' }).then((response) => { if (response.ok) { $settings.settingsSync = false; addNotification( options({ heading: 'Remote configuration deleted and settings sync disabled' }) ); } }); }} > {$locale().settings.settingsSync.buttons.delete} Last Push: {$locale().dateFormatter($settingsSyncTimes.lastPush)} Last Pull: {$locale().dateFormatter($settingsSyncTimes.lastPull)} {/if}