From 1041c0ade1700d1a56e4b2585c6a4e20d7123f81 Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 3 Oct 2024 20:53:24 +0200 Subject: Small fixes, fix policy list editor --- .../Pages/Tools/Info/PolicyListActivity.razor | 27 ++++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'MatrixUtils.Web/Pages/Tools/Info') diff --git a/MatrixUtils.Web/Pages/Tools/Info/PolicyListActivity.razor b/MatrixUtils.Web/Pages/Tools/Info/PolicyListActivity.razor index de0bfe7..f2af9b5 100644 --- a/MatrixUtils.Web/Pages/Tools/Info/PolicyListActivity.razor +++ b/MatrixUtils.Web/Pages/Tools/Info/PolicyListActivity.razor @@ -5,6 +5,8 @@ @using LibMatrix.EventTypes.Common + +@* *@ @if (RoomData.Count == 0) {

Loading...

@@ -15,10 +17,8 @@ else

@room.Key

@foreach (var year in room.Value.OrderBy(x => x.Key)) { -
@year.Key
- - + @year.Key + } } @@ -42,15 +42,22 @@ else await base.OnInitializedAsync(); Homeserver = (await RMUStorage.GetCurrentSessionOrNavigate())!; if (Homeserver is null) return; - + // //random test data - for (DateOnly i = new DateOnly(2020, 1, 1); i < new DateOnly(2020, 12, 30); i = i.AddDays(Random.Shared.Next(5))) + for (DateOnly i = new DateOnly(2020, 1, 1); i < new DateOnly(2020, 12, 30); i = i.AddDays(2)) { + // TestData[i] = new() + // { + // R = (int)(Random.Shared.NextSingle() * 255), + // G = (int)(Random.Shared.NextSingle() * 255), + // B = (int)(Random.Shared.NextSingle() * 255) + // }; + // rgb based on number of week TestData[i] = new() { - R = (int)(Random.Shared.NextSingle() * 255), - G = (int)(Random.Shared.NextSingle() * 255), - B = (int)(Random.Shared.NextSingle() * 255) + R = i.DayOfYear % 255, + G = i.DayOfYear + 96 % 255, + B = i.DayOfYear + 192 % 255 }; } @@ -109,7 +116,7 @@ else } //use timeline - var timeline = room.GetManyMessagesAsync(limit: int.MaxValue, chunkSize: 5000); + var timeline = room.GetManyMessagesAsync(limit: int.MaxValue, chunkSize: 2000); await foreach (var response in timeline) { Console.WriteLine($"Got {response.State.Count} state, {response.Chunk.Count} timeline"); -- cgit 1.5.1