add entity logs verb (#14170)
This commit is contained in:
@@ -174,6 +174,32 @@ public sealed partial class AdminLogsControl : Control
|
||||
UpdateLogs();
|
||||
}
|
||||
|
||||
public void SetTypesSelection(HashSet<LogType> selectedTypes, bool invert = false)
|
||||
{
|
||||
SelectedTypes.Clear();
|
||||
|
||||
foreach (var control in TypesContainer.Children)
|
||||
{
|
||||
if (control is not AdminLogTypeButton type)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (selectedTypes.Contains(type.Type) ^ invert)
|
||||
{
|
||||
type.Pressed = true;
|
||||
SelectedTypes.Add(type.Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
type.Pressed = false;
|
||||
type.Visible = ShouldShowType(type);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateLogs();
|
||||
}
|
||||
|
||||
public void UpdateTypes()
|
||||
{
|
||||
foreach (var control in TypesContainer.Children)
|
||||
|
||||
@@ -137,6 +137,15 @@ public sealed class AdminLogsEui : BaseEui
|
||||
|
||||
LogsControl.NextButton.Disabled = !newLogs.HasNext;
|
||||
break;
|
||||
|
||||
case SetLogFilter setLogFilter:
|
||||
if (setLogFilter.Search != null)
|
||||
LogsControl.LogSearch.SetText(setLogFilter.Search);
|
||||
|
||||
if (setLogFilter.Types != null)
|
||||
LogsControl.SetTypesSelection(setLogFilter.Types, setLogFilter.InvertTypes);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user