From c18d07538a891e80905a990e99f291514f009e50 Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Mon, 22 Nov 2021 18:55:17 +0100 Subject: [PATCH] Revert "Admin logs (#5419)" This reverts commit 319aec109d4d63a2e0dd2cf91cc2b8f4a4a5693b. --- .../Administration/Logs/AdminLogSystem.cs | 7 - .../UI/CustomControls/AdminLogImpactButton.cs | 16 - .../UI/CustomControls/AdminLogLabel.cs | 33 - .../UI/CustomControls/AdminLogPlayerButton.cs | 17 - .../UI/CustomControls/AdminLogTypeButton.cs | 16 - .../UI/CustomControls/HSeparator.cs | 25 - .../UI/CustomControls/VSeparator.cs | 25 - .../Administration/UI/Logs/AdminLogsEui.cs | 106 --- .../UI/Logs/AdminLogsWindow.xaml | 55 -- .../UI/Logs/AdminLogsWindow.xaml.cs | 439 --------- .../UI/Tabs/AdminTab/AdminTab.xaml | 1 - .../Administration/UI/Tabs/PlayerTab.xaml.cs | 34 +- .../ContentIntegrationTest.cs | 8 +- .../Tests/Administration/Logs/AddTests.cs | 197 ---- .../Tests/Administration/Logs/FilterTests.cs | 108 --- .../Tests/Administration/Logs/QueryTests.cs | 70 -- .../Content.Server.Database.csproj | 5 - .../20211120202701_AdminLogs.Designer.cs | 848 ----------------- .../Postgres/20211120202701_AdminLogs.cs | 171 ---- ...20211121123543_AdminLogsImpact.Designer.cs | 852 ------------------ .../20211121123543_AdminLogsImpact.cs | 26 - .../PostgresServerDbContextModelSnapshot.cs | 453 ++-------- .../20211120202654_AdminLogs.Designer.cs | 794 ---------------- .../Sqlite/20211120202654_AdminLogs.cs | 168 ---- ...20211121123536_AdminLogsImpact.Designer.cs | 798 ---------------- .../Sqlite/20211121123536_AdminLogsImpact.cs | 26 - .../SqliteServerDbContextModelSnapshot.cs | 388 ++------ Content.Server.Database/Model.cs | 75 -- Content.Server.Database/ModelSqlite.cs | 27 - Content.Server/Administration/AdminSystem.cs | 1 + .../Administration/Commands/AdminLogBulk.cs | 64 -- .../Commands/OpenAdminLogsCommand.cs | 30 - .../Administration/Logs/AdminLogSystem.cs | 302 ------- .../Administration/Logs/AdminLogsEui.cs | 204 ----- .../Logs/Converters/AdminLogConverter.cs | 15 - .../Converters/AdminLogConverterAttribute.cs | 10 - .../Logs/Converters/EntityJsonConverter.cs | 27 - .../Logs/Converters/FixedPoint2Converter.cs | 13 - .../Administration/Logs/LogFilter.cs | 33 - .../Administration/Logs/LogRecord.cs | 35 - .../Administration/Logs/QueuedLog.cs | 24 - .../Chemistry/ReagentEffects/HealthChange.cs | 1 + Content.Server/Database/ServerDbBase.cs | 206 ----- Content.Server/Database/ServerDbManager.cs | 73 +- Content.Server/Database/ServerDbSqlite.cs | 63 -- .../GameTicking/Events/RoundStartingEvent.cs | 10 - .../GameTicking/GameTicker.Player.cs | 11 - .../GameTicking/GameTicker.RoundFlow.cs | 16 +- .../Shuttles/EntitySystems/ThrusterSystem.cs | 6 +- Content.Shared/Administration/AdminFlags.cs | 5 - .../Administration/AdminLogsEuiState.cs | 85 -- .../Administration/Logs/DateOrder.cs | 7 - .../Administration/Logs/LogImpact.cs | 10 - .../Administration/Logs/LogStringHandler.cs | 110 --- Content.Shared/Administration/Logs/LogType.cs | 8 - .../Administration/Logs/SharedAdminLog.cs | 13 - .../Logs/SharedAdminLogSystem.cs | 17 - Content.Shared/CCVar/CCVars.cs | 14 - .../Damage/Components/DamageableComponent.cs | 1 - .../Damage/Systems/DamageableSystem.cs | 18 +- .../Damage/Systems/SlowOnDamageSystem.cs | 2 +- Content.Shared/FixedPoint/FixedPoint2.cs | 12 +- .../en-US/administration/ui/admin-logs.ftl | 20 - .../administration/ui/admin-menu-window.ftl | 2 +- SpaceStation14.sln.DotSettings | 1 - 65 files changed, 236 insertions(+), 7021 deletions(-) delete mode 100644 Content.Client/Administration/Logs/AdminLogSystem.cs delete mode 100644 Content.Client/Administration/UI/CustomControls/AdminLogImpactButton.cs delete mode 100644 Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs delete mode 100644 Content.Client/Administration/UI/CustomControls/AdminLogPlayerButton.cs delete mode 100644 Content.Client/Administration/UI/CustomControls/AdminLogTypeButton.cs delete mode 100644 Content.Client/Administration/UI/CustomControls/HSeparator.cs delete mode 100644 Content.Client/Administration/UI/CustomControls/VSeparator.cs delete mode 100644 Content.Client/Administration/UI/Logs/AdminLogsEui.cs delete mode 100644 Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml delete mode 100644 Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml.cs delete mode 100644 Content.IntegrationTests/Tests/Administration/Logs/AddTests.cs delete mode 100644 Content.IntegrationTests/Tests/Administration/Logs/FilterTests.cs delete mode 100644 Content.IntegrationTests/Tests/Administration/Logs/QueryTests.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20211120202701_AdminLogs.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20211120202701_AdminLogs.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20211121123543_AdminLogsImpact.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Postgres/20211121123543_AdminLogsImpact.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20211120202654_AdminLogs.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20211120202654_AdminLogs.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20211121123536_AdminLogsImpact.Designer.cs delete mode 100644 Content.Server.Database/Migrations/Sqlite/20211121123536_AdminLogsImpact.cs delete mode 100644 Content.Server/Administration/Commands/AdminLogBulk.cs delete mode 100644 Content.Server/Administration/Commands/OpenAdminLogsCommand.cs delete mode 100644 Content.Server/Administration/Logs/AdminLogSystem.cs delete mode 100644 Content.Server/Administration/Logs/AdminLogsEui.cs delete mode 100644 Content.Server/Administration/Logs/Converters/AdminLogConverter.cs delete mode 100644 Content.Server/Administration/Logs/Converters/AdminLogConverterAttribute.cs delete mode 100644 Content.Server/Administration/Logs/Converters/EntityJsonConverter.cs delete mode 100644 Content.Server/Administration/Logs/Converters/FixedPoint2Converter.cs delete mode 100644 Content.Server/Administration/Logs/LogFilter.cs delete mode 100644 Content.Server/Administration/Logs/LogRecord.cs delete mode 100644 Content.Server/Administration/Logs/QueuedLog.cs delete mode 100644 Content.Server/GameTicking/Events/RoundStartingEvent.cs delete mode 100644 Content.Shared/Administration/AdminLogsEuiState.cs delete mode 100644 Content.Shared/Administration/Logs/DateOrder.cs delete mode 100644 Content.Shared/Administration/Logs/LogImpact.cs delete mode 100644 Content.Shared/Administration/Logs/LogStringHandler.cs delete mode 100644 Content.Shared/Administration/Logs/LogType.cs delete mode 100644 Content.Shared/Administration/Logs/SharedAdminLog.cs delete mode 100644 Content.Shared/Administration/Logs/SharedAdminLogSystem.cs delete mode 100644 Resources/Locale/en-US/administration/ui/admin-logs.ftl diff --git a/Content.Client/Administration/Logs/AdminLogSystem.cs b/Content.Client/Administration/Logs/AdminLogSystem.cs deleted file mode 100644 index 895fd62925..0000000000 --- a/Content.Client/Administration/Logs/AdminLogSystem.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Content.Shared.Administration.Logs; - -namespace Content.Client.Administration.Logs; - -public class AdminLogSystem : SharedAdminLogSystem -{ -} diff --git a/Content.Client/Administration/UI/CustomControls/AdminLogImpactButton.cs b/Content.Client/Administration/UI/CustomControls/AdminLogImpactButton.cs deleted file mode 100644 index be4b198347..0000000000 --- a/Content.Client/Administration/UI/CustomControls/AdminLogImpactButton.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Content.Shared.Administration.Logs; -using Robust.Client.UserInterface.Controls; - -namespace Content.Client.Administration.UI.CustomControls; - -public class AdminLogImpactButton : Button -{ - public AdminLogImpactButton(LogImpact impact) - { - Impact = impact; - ToggleMode = true; - Pressed = true; - } - - public LogImpact Impact { get; } -} diff --git a/Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs b/Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs deleted file mode 100644 index 029d414a67..0000000000 --- a/Content.Client/Administration/UI/CustomControls/AdminLogLabel.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Content.Shared.Administration.Logs; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.Controls; - -namespace Content.Client.Administration.UI.CustomControls; - -public class AdminLogLabel : RichTextLabel -{ - public AdminLogLabel(ref SharedAdminLog log, HSeparator separator) - { - Log = log; - Separator = separator; - - SetMessage(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/AdminLogPlayerButton.cs b/Content.Client/Administration/UI/CustomControls/AdminLogPlayerButton.cs deleted file mode 100644 index a6606a066a..0000000000 --- a/Content.Client/Administration/UI/CustomControls/AdminLogPlayerButton.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using Robust.Client.UserInterface.Controls; - -namespace Content.Client.Administration.UI.CustomControls; - -public class AdminLogPlayerButton : Button -{ - public AdminLogPlayerButton(Guid id) - { - Id = id; - ClipText = true; - ToggleMode = true; - Pressed = true; - } - - public Guid Id { get; } -} diff --git a/Content.Client/Administration/UI/CustomControls/AdminLogTypeButton.cs b/Content.Client/Administration/UI/CustomControls/AdminLogTypeButton.cs deleted file mode 100644 index 0ad83eb0ea..0000000000 --- a/Content.Client/Administration/UI/CustomControls/AdminLogTypeButton.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Content.Shared.Administration.Logs; -using Robust.Client.UserInterface.Controls; - -namespace Content.Client.Administration.UI.CustomControls; - -public class AdminLogTypeButton : Button -{ - public AdminLogTypeButton(LogType type) - { - Type = type; - ToggleMode = true; - Pressed = true; - } - - public LogType Type { get; } -} diff --git a/Content.Client/Administration/UI/CustomControls/HSeparator.cs b/Content.Client/Administration/UI/CustomControls/HSeparator.cs deleted file mode 100644 index 3e7005942d..0000000000 --- a/Content.Client/Administration/UI/CustomControls/HSeparator.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Robust.Client.Graphics; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.Controls; -using Robust.Shared.Maths; - -namespace Content.Client.Administration.UI.CustomControls; - -public class HSeparator : Control -{ - private static readonly Color SeparatorColor = Color.FromHex("#3D4059"); - - public HSeparator(Color color) - { - AddChild(new PanelContainer - { - PanelOverride = new StyleBoxFlat - { - BackgroundColor = color, - ContentMarginBottomOverride = 2, ContentMarginLeftOverride = 2 - } - }); - } - - public HSeparator() : this(SeparatorColor) { } -} diff --git a/Content.Client/Administration/UI/CustomControls/VSeparator.cs b/Content.Client/Administration/UI/CustomControls/VSeparator.cs deleted file mode 100644 index b413cacd49..0000000000 --- a/Content.Client/Administration/UI/CustomControls/VSeparator.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Robust.Client.Graphics; -using Robust.Client.UserInterface.Controls; -using Robust.Shared.Maths; - -namespace Content.Client.Administration.UI.CustomControls; - -public class VSeparator : PanelContainer -{ - private static readonly Color SeparatorColor = Color.FromHex("#3D4059"); - - public VSeparator(Color color) - { - MinSize = (2, 5); - - AddChild(new PanelContainer - { - PanelOverride = new StyleBoxFlat - { - BackgroundColor = color - } - }); - } - - public VSeparator() : this(SeparatorColor) { } -} diff --git a/Content.Client/Administration/UI/Logs/AdminLogsEui.cs b/Content.Client/Administration/UI/Logs/AdminLogsEui.cs deleted file mode 100644 index a40a248f3c..0000000000 --- a/Content.Client/Administration/UI/Logs/AdminLogsEui.cs +++ /dev/null @@ -1,106 +0,0 @@ -using Content.Client.Eui; -using Content.Shared.Administration; -using Content.Shared.Administration.Logs; -using Content.Shared.Eui; -using JetBrains.Annotations; -using static Content.Shared.Administration.AdminLogsEuiMsg; - -namespace Content.Client.Administration.UI.Logs; - -[UsedImplicitly] -public class AdminLogsEui : BaseEui -{ - public AdminLogsEui() - { - Window = new AdminLogsWindow(); - Window.OnClose += () => SendMessage(new Close()); - Window.LogSearch.OnTextEntered += _ => RequestLogs(); - Window.RefreshButton.OnPressed += _ => RequestLogs(); - Window.NextButton.OnPressed += _ => NextLogs(); - } - - private AdminLogsWindow Window { get; } - - private bool FirstState { get; set; } = true; - - private void RequestLogs() - { - var round = Window.GetSelectedRoundId(); - var types = Window.GetSelectedLogTypes(); - var players = Window.GetSelectedPlayerIds(); - - var request = new LogsRequest( - round, - types, - null, - null, - null, - players, - null, - null, - DateOrder.Descending); - - SendMessage(request); - } - - private void NextLogs() - { - var request = new NextLogsRequest(); - SendMessage(request); - } - - private void TrySetFirstState(AdminLogsEuiState state) - { - if (!FirstState) - { - return; - } - - FirstState = false; - Window.SetCurrentRound(state.RoundId); - Window.SetRoundSpinBox(state.RoundId); - } - - public override void Opened() - { - Window.OpenCentered(); - } - - public override void HandleState(EuiStateBase state) - { - var s = (AdminLogsEuiState) state; - - TrySetFirstState(s); - - if (s.IsLoading) - { - return; - } - - Window.SetCurrentRound(s.RoundId); - Window.SetPlayers(s.Players); - } - - public override void HandleMessage(EuiMessageBase msg) - { - base.HandleMessage(msg); - - switch (msg) - { - case NewLogs {Replace: true} newLogs: - Window.SetLogs(newLogs.Logs); - break; - case NewLogs {Replace: false} newLogs: - Window.AddLogs(newLogs.Logs); - break; - } - } - - public override void Closed() - { - base.Closed(); - - Window.Close(); - Window.Dispose(); - } -} diff --git a/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml b/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml deleted file mode 100644 index 345e30cd27..0000000000 --- a/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - -