about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Tools/ViewAccountData.razor
blob: 398c7ce1951516a667075cd013744ef3305011c7 (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
@page "/Tools/ViewAccountData"
@using ArcaneLibs.Extensions
@using LibMatrix
@using LibMatrix.Filters
@using LibMatrix.Helpers
@using LibMatrix.Utilities
<h3>View account data</h3>
<hr/>
<pre>@globalAccountData?.Events.ToJson(ignoreNull: true)</pre>
<br/>

@foreach (var (key, value) in perRoomAccountData) {
    <u>@key</u><br/><hr/>
    <pre>@value?.Events.ToJson(ignoreNull: true)</pre>
}

@code {
    EventList? globalAccountData;
    Dictionary<string, EventList?> perRoomAccountData = new();

    protected override async Task OnInitializedAsync() {
        var hs = await RMUStorage.GetCurrentSessionOrNavigate();
        if (hs is null) return;
        perRoomAccountData = await hs.EnumerateAccountDataPerRoom();
        globalAccountData = await hs.EnumerateAccountData();

        StateHasChanged();
    }

}