@page "/Dev/Utilities"
@using System.Reflection
@using ArcaneLibs.Extensions
@using LibMatrix.Extensions
@using LibMatrix.Homeservers
@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 room 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