AdminLogsEuiState.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. using Content.Shared.Database;
  2. using Content.Shared.Eui;
  3. using Robust.Shared.Serialization;
  4. namespace Content.Shared.Administration.Logs;
  5. [Serializable, NetSerializable]
  6. public sealed class AdminLogsEuiState : EuiStateBase
  7. {
  8. public AdminLogsEuiState(int roundId, Dictionary<Guid, string> players, int roundLogs)
  9. {
  10. RoundId = roundId;
  11. Players = players;
  12. RoundLogs = roundLogs;
  13. }
  14. public bool IsLoading { get; set; }
  15. public int RoundId { get; }
  16. public Dictionary<Guid, string> Players { get; }
  17. public int RoundLogs { get; }
  18. }
  19. public static class AdminLogsEuiMsg
  20. {
  21. [Serializable, NetSerializable]
  22. public sealed class SetLogFilter : EuiMessageBase
  23. {
  24. public SetLogFilter(string? search = null, bool invertTypes = false, HashSet<LogType>? types = null)
  25. {
  26. Search = search;
  27. InvertTypes = invertTypes;
  28. Types = types;
  29. }
  30. public string? Search { get; set; }
  31. public bool InvertTypes { get; set; }
  32. public HashSet<LogType>? Types { get; set; }
  33. }
  34. [Serializable, NetSerializable]
  35. public sealed class NewLogs : EuiMessageBase
  36. {
  37. public NewLogs(List<SharedAdminLog> logs, bool replace, bool hasNext)
  38. {
  39. Logs = logs;
  40. Replace = replace;
  41. HasNext = hasNext;
  42. }
  43. public List<SharedAdminLog> Logs { get; set; }
  44. public bool Replace { get; set; }
  45. public bool HasNext { get; set; }
  46. }
  47. [Serializable, NetSerializable]
  48. public sealed class LogsRequest : EuiMessageBase
  49. {
  50. public LogsRequest(
  51. int? roundId,
  52. string? search,
  53. HashSet<LogType>? types,
  54. HashSet<LogImpact>? impacts,
  55. DateTime? before,
  56. DateTime? after,
  57. bool includePlayers,
  58. Guid[]? anyPlayers,
  59. Guid[]? allPlayers,
  60. bool includeNonPlayers,
  61. DateOrder dateOrder)
  62. {
  63. RoundId = roundId;
  64. Search = search;
  65. Types = types;
  66. Impacts = impacts;
  67. Before = before;
  68. After = after;
  69. IncludePlayers = includePlayers;
  70. AnyPlayers = anyPlayers is { Length: > 0 } ? anyPlayers : null;
  71. AllPlayers = allPlayers is { Length: > 0 } ? allPlayers : null;
  72. IncludeNonPlayers = includeNonPlayers;
  73. DateOrder = dateOrder;
  74. }
  75. public int? RoundId { get; set; }
  76. public string? Search { get; set; }
  77. public HashSet<LogType>? Types { get; set; }
  78. public HashSet<LogImpact>? Impacts { get; set; }
  79. public DateTime? Before { get; set; }
  80. public DateTime? After { get; set; }
  81. public bool IncludePlayers { get; set; }
  82. public Guid[]? AnyPlayers { get; set; }
  83. public Guid[]? AllPlayers { get; set; }
  84. public bool IncludeNonPlayers { get; set; }
  85. public DateOrder DateOrder { get; set; }
  86. }
  87. [Serializable, NetSerializable]
  88. public sealed class NextLogsRequest : EuiMessageBase
  89. {
  90. }
  91. }