@page "/Dev/Utilities" @using ArcaneLibs.Extensions @using MatrixUtils.Abstractions @inject ILocalStorageService LocalStorage @inject NavigationManager NavigationManager

Debug Tools


@if (Rooms.Count == 0) {

You are not in any rooms!

@*

Loading progress: @checkedRoomCount/@totalRoomCount

*@ } else {
Room List @foreach (var roomId in Rooms) { }
}
Send GET request to URL

@GetRequestResult
@code { public List Rooms { get; set; } = new(); public AuthenticatedHomeserverGeneric? hs { get; set; } protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); hs = await RMUStorage.GetCurrentSessionOrNavigate(); if (hs == null) return; Rooms = (await hs.GetJoinedRooms()).Select(x => x.RoomId).ToList(); Console.WriteLine("Fetched joined rooms!"); } //send req string GetRequestUrl { get; set; } = ""; string GetRequestResult { get; set; } = ""; private async Task SendGetRequest() { var httpClient = hs?.ClientHttpClient; try { var res = await httpClient.GetAsync(GetRequestUrl); if (res.IsSuccessStatusCode) { if (res.Content.Headers.ContentType.MediaType == "application/json") GetRequestResult = (await res.Content.ReadFromJsonAsync()).ToJson(); else GetRequestResult = await res.Content.ReadAsStringAsync(); StateHasChanged(); return; } if (res.Content.Headers.ContentType.MediaType == "application/json") GetRequestResult = $"Error: {res.StatusCode}\n" + (await res.Content.ReadFromJsonAsync()).ToJson(); else GetRequestResult = $"Error: {res.StatusCode}\n" + await res.Content.ReadAsStringAsync(); } catch (Exception e) { GetRequestResult = $"Error: {e}"; } StateHasChanged(); } }