From 5100068a78d5a9e9455acb89629239f717c580ce Mon Sep 17 00:00:00 2001 From: Vasilis The Pikachu Date: Sun, 31 Aug 2025 17:50:37 +0200 Subject: [PATCH] Revert "Admin Log Browser Improvements (#39130)" This reverts commit f67cebf7a4ed451f1911aa5c8bf6f04c198b917f. Per request of @Kowlin and @southbridge-fur Check out https://github.com/space-wizards/space-station-14/issues/39960 for further information --- .../UI/CustomControls/AdminLogLabel.cs | 33 + .../CustomControls/PlayerListControl.xaml.cs | 18 +- .../UI/CustomControls/PlayerListEntry.xaml.cs | 2 + .../UI/Logs/AdminLogsControl.xaml | 10 +- .../UI/Logs/AdminLogsControl.xaml.cs | 89 +- .../Administration/UI/Logs/AdminLogsEui.cs | 11 +- .../UI/Logs/Entries/AdminLogEntry.xaml | 14 - .../UI/Logs/Entries/AdminLogEntry.xaml.cs | 79 - .../UI/Logs/Entries/AdminLogEntryDetails.xaml | 44 - .../Logs/Entries/AdminLogEntryDetails.xaml.cs | 98 - .../UI/Tabs/PlayerTab/PlayerTab.xaml.cs | 2 + .../Options/UI/Tabs/AdminOptionsTab.xaml | 3 - .../Options/UI/Tabs/AdminOptionsTab.xaml.cs | 2 - ...0250723055137_AdminLogsCurtime.Designer.cs | 2125 ----------------- .../20250723055137_AdminLogsCurtime.cs | 29 - .../PostgresServerDbContextModelSnapshot.cs | 7 +- ...0250723055127_AdminLogsCurtime.Designer.cs | 2048 ---------------- .../Sqlite/20250723055127_AdminLogsCurtime.cs | 29 - .../SqliteServerDbContextModelSnapshot.cs | 4 - Content.Server.Database/Model.cs | 5 - .../Logs/AdminLogManager.Cache.cs | 2 +- .../Administration/Logs/AdminLogManager.cs | 3 - Content.Server/Database/ServerDbBase.cs | 2 +- .../Administration/Logs/SharedAdminLog.cs | 1 - Content.Shared/CCVar/CCVars.Interface.cs | 6 - .../en-US/administration/ui/admin-logs.ftl | 15 - .../en-US/escape-menu/ui/options-menu.ftl | 4 - 27 files changed, 77 insertions(+), 4608 deletions(-) create mode 100644 Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs delete mode 100644 Content.Client/Administration/UI/Logs/Entries/AdminLogEntry.xaml delete mode 100644 Content.Client/Administration/UI/Logs/Entries/AdminLogEntry.xaml.cs delete mode 100644 Content.Client/Administration/UI/Logs/Entries/AdminLogEntryDetails.xaml delete mode 100644 Content.Client/Administration/UI/Logs/Entries/AdminLogEntryDetails.xaml.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20250723055137_AdminLogsCurtime.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20250723055137_AdminLogsCurtime.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20250723055127_AdminLogsCurtime.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20250723055127_AdminLogsCurtime.cs diff --git a/Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs b/Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs new file mode 100644 index 0000000000..0de38ce234 --- /dev/null +++ b/Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs @@ -0,0 +1,33 @@ +using Content.Shared.Administration.Logs; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.Controls; + +namespace Content.Client.Administration.UI.CustomControls; + +public sealed class AdminLogLabel : RichTextLabel +{ + public AdminLogLabel(ref SharedAdminLog log, HSeparator separator) + { + Log = log; + Separator = separator; + + SetMessage($"{log.Date:HH:mm:ss}: {log.Message}"); + OnVisibilityChanged += VisibilityChanged; + } + + public SharedAdminLog Log { get; } + + public HSeparator Separator { get; } + + private void VisibilityChanged(Control control) + { + Separator.Visible = Visible; + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + + OnVisibilityChanged -= VisibilityChanged; + } +} diff --git a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs index 8027a00c54..c7fbf6c2dc 100644 --- a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs +++ b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs @@ -1,15 +1,16 @@ using System.Linq; -using System.Text.RegularExpressions; using Content.Client.Administration.Systems; using Content.Client.UserInterface.Controls; using Content.Client.Verbs.UI; using Content.Shared.Administration; using Robust.Client.AutoGenerated; +using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; using Robust.Shared.Input; +using Robust.Shared.Utility; namespace Content.Client.Administration.UI.CustomControls; @@ -95,26 +96,13 @@ public sealed partial class PlayerListControl : BoxContainer private void FilterList() { _sortedPlayerList.Clear(); - - Regex filterRegex; - // There is no neat way to handle invalid regex being submitted other than - // catching and ignoring the exception which gets thrown when it's invalid. - try - { - filterRegex = new Regex(FilterLineEdit.Text, RegexOptions.IgnoreCase); - } - catch (ArgumentException) - { - return; - } - foreach (var info in _playerList) { var displayName = $"{info.CharacterName} ({info.Username})"; if (info.IdentityName != info.CharacterName) displayName += $" [{info.IdentityName}]"; if (!string.IsNullOrEmpty(FilterLineEdit.Text) - && !filterRegex.IsMatch(displayName)) + && !displayName.ToLowerInvariant().Contains(FilterLineEdit.Text.Trim().ToLowerInvariant())) continue; _sortedPlayerList.Add(info); } diff --git a/Content.Client/Administration/UI/CustomControls/PlayerListEntry.xaml.cs b/Content.Client/Administration/UI/CustomControls/PlayerListEntry.xaml.cs index f62a6c71e4..cd6a56ea71 100644 --- a/Content.Client/Administration/UI/CustomControls/PlayerListEntry.xaml.cs +++ b/Content.Client/Administration/UI/CustomControls/PlayerListEntry.xaml.cs @@ -1,8 +1,10 @@ using Content.Client.Stylesheets; using Content.Shared.Administration; using Robust.Client.AutoGenerated; +using Robust.Client.GameObjects; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Utility; namespace Content.Client.Administration.UI.CustomControls; diff --git a/Content.Client/Administration/UI/Logs/AdminLogsControl.xaml b/Content.Client/Administration/UI/Logs/AdminLogsControl.xaml index c646e380d4..cd93ffeb0a 100644 --- a/Content.Client/Administration/UI/Logs/AdminLogsControl.xaml +++ b/Content.Client/Administration/UI/Logs/AdminLogsControl.xaml @@ -1,6 +1,5 @@  + xmlns:aui="clr-namespace:Content.Client.Administration.UI.CustomControls"> @@ -53,13 +52,6 @@