OpenAdminLogsCommand.cs 817 B

123456789101112131415161718192021222324252627
  1. using Content.Server.Administration.Logs;
  2. using Content.Server.EUI;
  3. using Content.Shared.Administration;
  4. using Robust.Shared.Console;
  5. namespace Content.Server.Administration.Commands;
  6. [AdminCommand(AdminFlags.Logs)]
  7. public sealed class OpenAdminLogsCommand : IConsoleCommand
  8. {
  9. public string Command => "adminlogs";
  10. public string Description => "Opens the admin logs panel.";
  11. public string Help => $"Usage: {Command}";
  12. public void Execute(IConsoleShell shell, string argStr, string[] args)
  13. {
  14. if (shell.Player is not { } player)
  15. {
  16. shell.WriteError(Loc.GetString("shell-cannot-run-command-from-server"));
  17. return;
  18. }
  19. var eui = IoCManager.Resolve<EuiManager>();
  20. var ui = new AdminLogsEui();
  21. eui.OpenEui(ui, player);
  22. }
  23. }