about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Tools/User/ViewAccountData.razor
diff options
context:
space:
mode:
Diffstat (limited to 'MatrixUtils.Web/Pages/Tools/User/ViewAccountData.razor')
-rw-r--r--MatrixUtils.Web/Pages/Tools/User/ViewAccountData.razor27
1 files changed, 27 insertions, 0 deletions
diff --git a/MatrixUtils.Web/Pages/Tools/User/ViewAccountData.razor b/MatrixUtils.Web/Pages/Tools/User/ViewAccountData.razor
new file mode 100644
index 0000000..d8b02bb
--- /dev/null
+++ b/MatrixUtils.Web/Pages/Tools/User/ViewAccountData.razor
@@ -0,0 +1,27 @@
+@page "/Tools/ViewAccountData"
+@using ArcaneLibs.Extensions
+@using LibMatrix
+<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();
+    }
+
+}
\ No newline at end of file