blob: 8511a26016f04eb5177ac6ba8c31716f3a1c864c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
@page "/DevOptions"
@using LibMatrix.Extensions
@using ArcaneLibs.Extensions
@inject NavigationManager NavigationManager
@inject ILocalStorageService LocalStorage
<PageTitle>Developer options</PageTitle>
<h3>Rory&::MatrixUtils - Developer options</h3>
<hr/>
<InputCheckbox @bind-Value="@settings.DeveloperSettings.EnableLogViewers" @oninput="@LogStuff"></InputCheckbox><label> Enable log views</label><br/>
<InputCheckbox @bind-Value="@settings.DeveloperSettings.EnableConsoleLogging" @oninput="@LogStuff"></InputCheckbox><label> Enable console logging</label><br/>
<InputCheckbox @bind-Value="@settings.DeveloperSettings.EnablePortableDevtools" @oninput="@LogStuff"></InputCheckbox><label> Enable portable devtools</label><br/>
<br/>
@code {
MRUStorageWrapper.Settings settings { get; set; } = new();
protected override async Task OnInitializedAsync() {
settings = await TieredStorage.DataStorageProvider.LoadObjectAsync<MRUStorageWrapper.Settings>("mru.settings");
await base.OnInitializedAsync();
}
private async Task LogStuff() {
await Task.Delay(100);
Console.WriteLine($"Settings: {settings.ToJson()}");
await TieredStorage.DataStorageProvider.SaveObjectAsync("mru.settings", settings);
}
}
|