mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-21 12:12:48 +00:00
feat(dashboard): browse every client system info report, per account and across accounts
The account page lists the account's reports as a table and the Client System Info page lists every report (or each account's newest), sortable and searchable by account name or video card; a row opens every field. Values that say little about the real system are marked, and every caveat is a tooltip on the value and column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -389,3 +389,40 @@ TEST(ClientSysInfoSqlite, PruningDropsRowsNotSeenSince) {
|
||||
EXPECT_TRUE(g_Db->GetClientSysInfo(903, 10).empty());
|
||||
EXPECT_EQ(g_Db->GetClientSysInfo(904, 10).size(), 1u);
|
||||
}
|
||||
|
||||
TEST(ClientSysInfoSqlite, ListsAcrossAccounts) {
|
||||
auto s = SysInfo(910, 7000);
|
||||
g_Db->RecordClientSysInfo(s);
|
||||
s.buildNumber = 2600;
|
||||
s.lastSeen = 7100;
|
||||
g_Db->RecordClientSysInfo(s);
|
||||
s.accountId = 911;
|
||||
s.videoCard = "Other Adapter (HAL-hw vp)";
|
||||
g_Db->RecordClientSysInfo(s);
|
||||
|
||||
IClientSysInfo::SysInfoQuery q;
|
||||
q.accountId = 910;
|
||||
auto rows = g_Db->ListClientSysInfo(q);
|
||||
ASSERT_EQ(rows.size(), 2u);
|
||||
EXPECT_EQ(rows[0].buildNumber, 2600u); // newest first
|
||||
EXPECT_EQ(g_Db->CountClientSysInfo(q), 2u);
|
||||
q.ascending = true;
|
||||
q.order = IClientSysInfo::eSysInfoOrder::OS_VERSION;
|
||||
EXPECT_EQ(g_Db->ListClientSysInfo(q)[0].buildNumber, 2600u);
|
||||
|
||||
IClientSysInfo::SysInfoQuery search;
|
||||
search.search = "Other Adapter";
|
||||
rows = g_Db->ListClientSysInfo(search);
|
||||
ASSERT_EQ(rows.size(), 1u);
|
||||
EXPECT_EQ(rows[0].accountId, 911u);
|
||||
// A LIKE wildcard in the search is taken literally
|
||||
search.search = "%";
|
||||
EXPECT_EQ(g_Db->CountClientSysInfo(search), 0u);
|
||||
|
||||
IClientSysInfo::SysInfoQuery latest;
|
||||
latest.latestOnly = true;
|
||||
latest.accountId = 910;
|
||||
rows = g_Db->ListClientSysInfo(latest);
|
||||
ASSERT_EQ(rows.size(), 1u);
|
||||
EXPECT_EQ(rows[0].buildNumber, 2600u);
|
||||
}
|
||||
|
||||
@@ -1485,6 +1485,33 @@ TEST_F(ParitySeeded, Moderation) {
|
||||
}
|
||||
return out;
|
||||
});
|
||||
Both("ListClientSysInfo", [](GameDatabase& db) {
|
||||
json out = json::array();
|
||||
const auto list = [&db, &out](const IClientSysInfo::SysInfoQuery& q) {
|
||||
json rows = json::array();
|
||||
for (const auto& r : db.ListClientSysInfo(q)) rows.push_back({ r.accountId, r.accountName, r.buildNumber, r.logins });
|
||||
out.push_back({ rows, db.CountClientSysInfo(q) });
|
||||
};
|
||||
IClientSysInfo::SysInfoQuery q;
|
||||
list(q);
|
||||
q.latestOnly = true;
|
||||
list(q);
|
||||
q = {};
|
||||
q.accountId = 1;
|
||||
q.order = IClientSysInfo::eSysInfoOrder::OS_VERSION;
|
||||
q.ascending = true;
|
||||
list(q);
|
||||
q = {};
|
||||
q.search = "Card";
|
||||
q.order = IClientSysInfo::eSysInfoOrder::ACCOUNT;
|
||||
q.limit = 2;
|
||||
q.offset = 1;
|
||||
list(q);
|
||||
q = {};
|
||||
q.search = "no such card";
|
||||
list(q);
|
||||
return out;
|
||||
});
|
||||
Both("PruneLog client sysinfo", [](GameDatabase& db) { return db.PruneLog(IDashboardAdmin::eLog::CLIENT_SYSINFO, 1700000150); });
|
||||
Both("InsertModerationDecision", [](GameDatabase& db) {
|
||||
db.InsertModerationDecision("name", CHAR_ALICE2, "AliceRenamed", false, "Not allowed", 1700000000);
|
||||
|
||||
Reference in New Issue
Block a user