2022-04-16 20:57:50 +02:00
|
|
|
|
using Content.Shared.Database;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
using Content.Shared.Eui;
|
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
2022-04-16 20:57:50 +02:00
|
|
|
|
namespace Content.Shared.Administration.Logs;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class AdminLogsEuiState : EuiStateBase
|
2021-11-22 19:08:27 +01:00
|
|
|
|
{
|
2023-05-17 04:04:28 -07:00
|
|
|
|
public AdminLogsEuiState(int roundId, Dictionary<Guid, string> players, int roundLogs)
|
2021-11-22 19:08:27 +01:00
|
|
|
|
{
|
|
|
|
|
|
RoundId = roundId;
|
|
|
|
|
|
Players = players;
|
2023-05-17 04:04:28 -07:00
|
|
|
|
RoundLogs = roundLogs;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsLoading { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public int RoundId { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<Guid, string> Players { get; }
|
2023-05-17 04:04:28 -07:00
|
|
|
|
|
|
|
|
|
|
public int RoundLogs { get; }
|
2021-11-22 19:08:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static class AdminLogsEuiMsg
|
|
|
|
|
|
{
|
2023-02-18 19:00:17 -06:00
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public sealed class SetLogFilter : EuiMessageBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public SetLogFilter(string? search = null, bool invertTypes = false, HashSet<LogType>? types = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Search = search;
|
|
|
|
|
|
InvertTypes = invertTypes;
|
|
|
|
|
|
Types = types;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public string? Search { get; set; }
|
|
|
|
|
|
public bool InvertTypes { get; set; }
|
|
|
|
|
|
public HashSet<LogType>? Types { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-11-22 19:08:27 +01:00
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public sealed class NewLogs : EuiMessageBase
|
|
|
|
|
|
{
|
2022-06-29 10:38:24 +02:00
|
|
|
|
public NewLogs(List<SharedAdminLog> logs, bool replace, bool hasNext)
|
2021-11-22 19:08:27 +01:00
|
|
|
|
{
|
|
|
|
|
|
Logs = logs;
|
|
|
|
|
|
Replace = replace;
|
2022-06-29 10:38:24 +02:00
|
|
|
|
HasNext = hasNext;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-25 02:07:12 +01:00
|
|
|
|
public List<SharedAdminLog> Logs { get; set; }
|
2021-11-22 19:08:27 +01:00
|
|
|
|
public bool Replace { get; set; }
|
2022-06-29 10:38:24 +02:00
|
|
|
|
public bool HasNext { get; set; }
|
2021-11-22 19:08:27 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public sealed class LogsRequest : EuiMessageBase
|
|
|
|
|
|
{
|
|
|
|
|
|
public LogsRequest(
|
|
|
|
|
|
int? roundId,
|
2022-06-29 09:53:58 +02:00
|
|
|
|
string? search,
|
2021-12-24 20:48:21 +01:00
|
|
|
|
HashSet<LogType>? types,
|
|
|
|
|
|
HashSet<LogImpact>? impacts,
|
2021-11-22 19:08:27 +01:00
|
|
|
|
DateTime? before,
|
|
|
|
|
|
DateTime? after,
|
2023-02-28 10:09:35 -06:00
|
|
|
|
bool includePlayers,
|
2021-11-22 19:08:27 +01:00
|
|
|
|
Guid[]? anyPlayers,
|
|
|
|
|
|
Guid[]? allPlayers,
|
2023-02-28 10:09:35 -06:00
|
|
|
|
bool includeNonPlayers,
|
2021-11-22 19:08:27 +01:00
|
|
|
|
DateOrder dateOrder)
|
|
|
|
|
|
{
|
|
|
|
|
|
RoundId = roundId;
|
2022-06-29 09:53:58 +02:00
|
|
|
|
Search = search;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
Types = types;
|
|
|
|
|
|
Impacts = impacts;
|
|
|
|
|
|
Before = before;
|
|
|
|
|
|
After = after;
|
2023-02-28 10:09:35 -06:00
|
|
|
|
IncludePlayers = includePlayers;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
AnyPlayers = anyPlayers is { Length: > 0 } ? anyPlayers : null;
|
|
|
|
|
|
AllPlayers = allPlayers is { Length: > 0 } ? allPlayers : null;
|
2023-02-28 10:09:35 -06:00
|
|
|
|
IncludeNonPlayers = includeNonPlayers;
|
2021-11-22 19:08:27 +01:00
|
|
|
|
DateOrder = dateOrder;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int? RoundId { get; set; }
|
2022-06-29 09:53:58 +02:00
|
|
|
|
public string? Search { get; set; }
|
2021-12-24 20:48:21 +01:00
|
|
|
|
public HashSet<LogType>? Types { get; set; }
|
|
|
|
|
|
public HashSet<LogImpact>? Impacts { get; set; }
|
2021-11-22 19:08:27 +01:00
|
|
|
|
public DateTime? Before { get; set; }
|
|
|
|
|
|
public DateTime? After { get; set; }
|
2023-02-28 10:09:35 -06:00
|
|
|
|
public bool IncludePlayers { get; set; }
|
2021-11-22 19:08:27 +01:00
|
|
|
|
public Guid[]? AnyPlayers { get; set; }
|
|
|
|
|
|
public Guid[]? AllPlayers { get; set; }
|
2023-02-28 10:09:35 -06:00
|
|
|
|
public bool IncludeNonPlayers { get; set; }
|
2021-11-22 19:08:27 +01:00
|
|
|
|
public DateOrder DateOrder { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
|
public sealed class NextLogsRequest : EuiMessageBase
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|