Cockatrice/cockatrice/src/interface/widgets/tabs/tab_logs.h
Lukas Brübach 7a18670bfd
[Server/Client/Protocol] Add developer staff role
Introduce a Developer staff level (proto flag 32, DB admin bit 8) that
sits between admin and moderator: no kick/ban/warn/report/admin powers,
but gets server log access via a new developer command container family
(GET_SERVER_STATS, VIEWLOG_HISTORY) and an idle-timeout exemption.

- Protocol: IsDeveloper flag, developer_commands.proto envelope,
  Command_GetServerStats/Command_GetLogHistory, Response_GetServerStats,
  Command_AdjustMod.should_be_developer
- Servatrice: fail-closed developer dispatcher, uptime snapshot handler,
  shared log history handler reuse, bit-8 DB mapping
- Client: burgundy pawn/badge/labels/sort order, prepareDeveloperCommand,
  minimal Developer stats tab, log tab access, promote/demote actions

Took 24 minutes

Took 18 seconds

# Commit time for manual adjustment:
# Took 15 minutes
2026-08-30 13:45:24 +02:00

71 lines
1.8 KiB
C++

/**
* @file tab_logs.h
* @ingroup ServerTabs
*/
//! \todo Document this file.
#ifndef TAB_LOG_H
#define TAB_LOG_H
#include "tab.h"
#include <QDialog>
class AbstractClient;
class LineEditUnfocusable;
class QGroupBox;
class QPushButton;
class QSpinBox;
class QCheckBox;
class QRadioButton;
class QLabel;
class QDockWidget;
class QWidget;
class QGridLayout;
class QVBoxLayout;
class QTableWidget;
class CommandContainer;
class Response;
class AbstractClient;
class TabLog : public Tab
{
Q_OBJECT
private:
AbstractClient *client;
bool canUseDeveloperCommands;
QLabel *labelFindUserName, *labelFindIPAddress, *labelFindGameName, *labelFindGameID, *labelMessage, *labelMaximum,
*labelDescription;
LineEditUnfocusable *findUsername, *findIPAddress, *findGameName, *findGameID, *findMessage;
QCheckBox *mainRoom, *gameRoom, *privateChat;
QRadioButton *pastDays, *today, *lastHour;
QSpinBox *maximumResults, *pastXDays;
QDockWidget *searchDock;
QWidget *searchDockContents;
QPushButton *getButton, *clearButton;
QGridLayout *criteriaGrid, *locationGrid, *rangeGrid, *maxResultsGrid, *descriptionGrid, *buttonGrid;
QGroupBox *criteriaGroupBox, *locationGroupBox, *rangeGroupBox, *maxResultsGroupBox, *descriptionGroupBox,
*buttonGroupBox;
QVBoxLayout *mainLayout;
QTableWidget *roomTable, *gameTable, *chatTable;
void createDock();
signals:
private slots:
void getClicked();
void clearClicked();
void viewLogHistory_processResponse(const Response &resp);
void restartLayout();
public:
TabLog(TabSupervisor *_tabSupervisor, AbstractClient *_client, bool _canUseDeveloperCommands = false);
~TabLog() override;
void retranslateUi() override;
[[nodiscard]] QString getTabText() const override
{
return tr("Logs");
}
};
#endif