Include text search in admin logs db query (#9274)
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using Content.Client.Administration.UI.CustomControls;
|
||||
using Content.Shared.Administration.Logs;
|
||||
@@ -9,7 +7,6 @@ using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Localization;
|
||||
using static Robust.Client.UserInterface.Controls.BaseButton;
|
||||
using static Robust.Client.UserInterface.Controls.LineEdit;
|
||||
|
||||
@@ -53,6 +50,7 @@ public sealed partial class AdminLogsControl : Control
|
||||
private int CurrentRound { get; set; }
|
||||
|
||||
public int SelectedRoundId => RoundSpinBox.Value;
|
||||
public string Search => LogSearch.Text;
|
||||
|
||||
public HashSet<LogType> SelectedTypes { get; } = new();
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ public sealed class AdminLogsEui : BaseEui
|
||||
{
|
||||
var request = new LogsRequest(
|
||||
LogsControl.SelectedRoundId,
|
||||
LogsControl.Search,
|
||||
LogsControl.SelectedTypes.ToHashSet(),
|
||||
null,
|
||||
null,
|
||||
|
||||
@@ -108,6 +108,7 @@ public sealed class AdminLogsEui : BaseEui
|
||||
{
|
||||
CancellationToken = _logSendCancellation.Token,
|
||||
Round = request.RoundId,
|
||||
Search = request.Search,
|
||||
Types = request.Types,
|
||||
Impacts = request.Impacts,
|
||||
Before = request.Before,
|
||||
|
||||
@@ -45,6 +45,7 @@ public static class AdminLogsEuiMsg
|
||||
{
|
||||
public LogsRequest(
|
||||
int? roundId,
|
||||
string? search,
|
||||
HashSet<LogType>? types,
|
||||
HashSet<LogImpact>? impacts,
|
||||
DateTime? before,
|
||||
@@ -55,6 +56,7 @@ public static class AdminLogsEuiMsg
|
||||
DateOrder dateOrder)
|
||||
{
|
||||
RoundId = roundId;
|
||||
Search = search;
|
||||
Types = types;
|
||||
Impacts = impacts;
|
||||
Before = before;
|
||||
@@ -66,6 +68,7 @@ public static class AdminLogsEuiMsg
|
||||
}
|
||||
|
||||
public int? RoundId { get; set; }
|
||||
public string? Search { get; set; }
|
||||
public HashSet<LogType>? Types { get; set; }
|
||||
public HashSet<LogImpact>? Impacts { get; set; }
|
||||
public DateTime? Before { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user