Fix "Next" never sending admin logs for rounds outside the cache, show a round's total logs on the UI (#16531)
* Fix next never sending logs for rounds outside the cache * Show round's total log count on the ui * Disable next button when waiting for a next response * Cleanup AdminLogsEui.CurrentRoundId * Fix popout window width
This commit is contained in:
@@ -794,8 +794,8 @@ INSERT INTO player_round (players_id, rounds_id) VALUES ({players[player]}, {id}
|
||||
{
|
||||
query = filter.DateOrder switch
|
||||
{
|
||||
DateOrder.Ascending => query.Where(log => log.Id < filter.LastLogId),
|
||||
DateOrder.Descending => query.Where(log => log.Id > filter.LastLogId),
|
||||
DateOrder.Ascending => query.Where(log => log.Id > filter.LastLogId),
|
||||
DateOrder.Descending => query.Where(log => log.Id < filter.LastLogId),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(filter),
|
||||
$"Unknown {nameof(DateOrder)} value {filter.DateOrder}")
|
||||
};
|
||||
@@ -862,6 +862,12 @@ INSERT INTO player_round (players_id, rounds_id) VALUES ({players[player]}, {id}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<int> CountAdminLogs(int round)
|
||||
{
|
||||
await using var db = await GetDb();
|
||||
return await db.DbContext.AdminLog.CountAsync(log => log.RoundId == round);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Whitelist
|
||||
|
||||
Reference in New Issue
Block a user