about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Tools/Info
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-10-03 20:53:24 +0200
committerRory& <root@rory.gay>2024-10-03 20:53:24 +0200
commit1041c0ade1700d1a56e4b2585c6a4e20d7123f81 (patch)
treee6af21cd725b34517501acd5088fb5805506cf16 /MatrixUtils.Web/Pages/Tools/Info
parentChanges (diff)
downloadMatrixUtils-1041c0ade1700d1a56e4b2585c6a4e20d7123f81.tar.xz
Small fixes, fix policy list editor
Diffstat (limited to 'MatrixUtils.Web/Pages/Tools/Info')
-rw-r--r--MatrixUtils.Web/Pages/Tools/Info/PolicyListActivity.razor27
1 files changed, 17 insertions, 10 deletions
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 + +@* <ActivityGraph Data="TestData"/> *@ @if (RoomData.Count == 0) { <p>Loading...</p> @@ -15,10 +17,8 @@ else <h3>@room.Key</h3> @foreach (var year in room.Value.OrderBy(x => x.Key)) { - <h5>@year.Key</h5> - <ActivityGraph Data="@year.Value" GlobalMax="MaxValue" - RLabel="removed" GLabel="new" BLabel="updated policies"> - </ActivityGraph> + <span>@year.Key</span> + <ActivityGraph Data="@year.Value" GlobalMax="MaxValue" RLabel="removed" GLabel="new" BLabel="updated policies"/> } } @@ -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");