@* * Copyright 2024 Ivy Collective * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @page "/settings" @layout MainLayout @using Blazored.LocalStorage @inject SettingsService savedSettings @inject ILocalStorageService localStorage @inject NavigationManager Navigation Settings

Settings

Apply changes Undo changes

Appearance

Switch between light and dark mode, and pick your accent color

System (automatically set) Light Dark

API Server

If your API server isn't the default, you can change it here.

Make sure the URL doesn't end with a /, and is a valid URL. You'll be automatically signed out when reloading the page.

Sign out

You can sign out here. If you want to, you can optionally sign out of all linked applications for your account.

Sign out Unlink applications

Reset settings to defaults

Reset all to defaults (cannot be undone) @code { public SiteSettings DefaultSettings { get; set; } = new SiteSettings(); public SiteSettings TmpSettings { get; set; } = new SiteSettings(); protected override Task OnInitializedAsync() { ResetSettings(); return Task.CompletedTask; } public void ResetSettings() { TmpSettings = savedSettings.Settings; } public async Task ApplySettingsAsync() { savedSettings.Settings = TmpSettings; await localStorage.SetItemAsync("settings", savedSettings.Serialize()); } public async Task ResetToDefaultsAndSave() { TmpSettings = DefaultSettings.Clone(); await ApplySettingsAsync(); } public async Task SignOut() { await localStorage.RemoveItemAsync("jwt"); Navigation.NavigateTo("/login"); } }