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:
@@ -54,6 +54,7 @@ public sealed partial class AdminLogsControl : Control
|
||||
public string Search => LogSearch.Text;
|
||||
private int ShownLogs { get; set; }
|
||||
private int TotalLogs { get; set; }
|
||||
private int RoundLogs { get; set; }
|
||||
public bool IncludeNonPlayerLogs { get; set; }
|
||||
|
||||
public HashSet<LogType> SelectedTypes { get; } = new();
|
||||
@@ -485,7 +486,7 @@ public sealed partial class AdminLogsControl : Control
|
||||
AddLogs(logs);
|
||||
}
|
||||
|
||||
private void UpdateCount(int? shown = null, int? total = null)
|
||||
public void UpdateCount(int? shown = null, int? total = null, int? round = null)
|
||||
{
|
||||
if (shown != null)
|
||||
{
|
||||
@@ -497,7 +498,15 @@ public sealed partial class AdminLogsControl : Control
|
||||
TotalLogs = total.Value;
|
||||
}
|
||||
|
||||
Count.Text = Loc.GetString("admin-logs-count", ("showing", ShownLogs), ("total", TotalLogs));
|
||||
if (round != null)
|
||||
{
|
||||
RoundLogs = round.Value;
|
||||
}
|
||||
|
||||
Count.Text = Loc.GetString(
|
||||
"admin-logs-count",
|
||||
("showing", ShownLogs), ("total", TotalLogs), ("round", RoundLogs)
|
||||
);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
||||
@@ -70,6 +70,7 @@ public sealed class AdminLogsEui : BaseEui
|
||||
|
||||
private void NextLogs()
|
||||
{
|
||||
LogsControl.NextButton.Disabled = true;
|
||||
var request = new NextLogsRequest();
|
||||
SendMessage(request);
|
||||
}
|
||||
@@ -88,7 +89,7 @@ public sealed class AdminLogsEui : BaseEui
|
||||
Maximized = false,
|
||||
Title = "Admin Logs",
|
||||
Monitor = monitor,
|
||||
Width = 1000,
|
||||
Width = 1100,
|
||||
Height = 400
|
||||
});
|
||||
|
||||
@@ -117,6 +118,7 @@ public sealed class AdminLogsEui : BaseEui
|
||||
|
||||
LogsControl.SetCurrentRound(s.RoundId);
|
||||
LogsControl.SetPlayers(s.Players);
|
||||
LogsControl.UpdateCount(round: s.RoundLogs);
|
||||
|
||||
if (!FirstState)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
xmlns:logs="clr-namespace:Content.Client.Administration.UI.Logs"
|
||||
Title="{Loc admin-logs-title}"
|
||||
SetSize="1000 400">
|
||||
SetSize="1100 400">
|
||||
<logs:AdminLogsControl Name="Logs" Access="Public"/>
|
||||
</DefaultWindow>
|
||||
|
||||
Reference in New Issue
Block a user