diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Pages')
-rw-r--r-- | MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor | 25 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerTimeline.razor | 2 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Pages/Rooms/Index.razor | 22 |
3 files changed, 40 insertions, 9 deletions
diff --git a/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor b/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor index e6f95c7..a62362b 100644 --- a/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor +++ b/MatrixRoomUtils.Web/Pages/HSAdmin/RoomQuery.razor @@ -18,19 +18,26 @@ <button class="btn btn-primary" @onclick="Search">Search</button> <br/> +@if (Results.Count > 0) { + <p>Found @Results.Count rooms</p> +} + @foreach (var res in Results) { <div style="background-color: #ffffff11; border-radius: 0.5em; display: block; margin-top: 4px; padding: 4px;"> <RoomListItem RoomName="@res.Name" RoomId="@res.RoomId"></RoomListItem> <p> - @res.CanonicalAlias + @if (!string.IsNullOrWhiteSpace(res.CanonicalAlias)) { + <span>@res.CanonicalAlias (@res.RoomId)</span><br/> + } + else { + <span>@res.RoomId</span><br/> + } @if (!string.IsNullOrWhiteSpace(res.Creator)) { - <span> - , created by <InlineUserItem UserId="@res.Creator"></InlineUserItem> - </span> + <span>Created by <InlineUserItem UserId="@res.Creator"></InlineUserItem></span><br/> } </p> - <p>@res.StateEvents state events</p> - <p>@res.JoinedMembers members, of which @res.JoinedLocalMembers are on this server</p> + <span>@res.StateEvents state events</span><br/> + <span>@res.JoinedMembers members, of which @res.JoinedLocalMembers are on this server</span> </div> } @@ -41,11 +48,11 @@ public string? OrderBy { get; set; } [Parameter] - [SupplyParameterFromQuery(Name = "search_term")] + [SupplyParameterFromQuery(Name = "name_search")] public string SearchTerm { get; set; } [Parameter] - [SupplyParameterFromQuery(Name = "content_search_term")] + [SupplyParameterFromQuery(Name = "content_search")] public string ContentSearchTerm { get; set; } [Parameter] @@ -69,6 +76,8 @@ var room = searchRooms.Current; Console.WriteLine("Hit: " + room.ToJson(false)); Results.Add(room); + if (Results.Count % 10 == 0) + StateHasChanged(); } } diff --git a/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerTimeline.razor b/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerTimeline.razor index 2db7cab..b90cc09 100644 --- a/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerTimeline.razor +++ b/MatrixRoomUtils.Web/Pages/RoomManager/RoomManagerTimeline.razor @@ -1,4 +1,4 @@ -@page "/RoomManager/Timeline/{RoomId}" +@page "/Rooms/{RoomId}/Timeline" @using MatrixRoomUtils.Web.Shared.TimelineComponents <h3>RoomManagerTimeline</h3> <hr/> diff --git a/MatrixRoomUtils.Web/Pages/Rooms/Index.razor b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor new file mode 100644 index 0000000..17551c9 --- /dev/null +++ b/MatrixRoomUtils.Web/Pages/Rooms/Index.razor @@ -0,0 +1,22 @@ +@page "/Rooms" +<h3>Room list</h3> + +@if (Rooms != null) { + <RoomList Rooms="Rooms"></RoomList> +} + + +@code { + + private List<Room> Rooms { get; set; } + + protected override async Task OnInitializedAsync() + { + await LocalStorageWrapper.LoadFromLocalStorage(LocalStorage); + + Rooms = await RuntimeCache.CurrentHomeServer.GetJoinedRooms(); + + await base.OnInitializedAsync(); + } + +} \ No newline at end of file |