Files
DarkflameServer/dDashboardServer/routes/ClientSysInfoView.h
Aaron Kimbrell d94d84b5cb 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>
2026-09-30 08:06:02 -05:00

42 lines
1.8 KiB
C++

#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "IClientSysInfo.h"
#include "json.hpp"
/**
* How the dashboard shows the system info clients send at login (client_sysinfo), without the database or web server.
* Every value is as reported by the client: old Windows calls in a 32-bit program without a compatibility manifest,
* so several fields are compatibility values rather than the player's real hardware. Caveats() says what each field
* is worth; the routes are in ClientSysInfoRoutes.cpp.
*/
namespace ClientSysInfoView {
// field -> what it is and how far to trust it, for the page and the API
const nlohmann::json& Caveats();
// field -> "unreliable" (says little or nothing about the player's system) or "approximate" (usually right, with
// exceptions); fields not listed can be taken as sent
const nlohmann::json& Trust();
// One row as the dashboard sends it: the raw values, plus labels and the memory text split into numbers. The
// address is only included when showIp (logs_audit).
nlohmann::json RowJson(const IClientSysInfo::SysInfoRow& row, bool showIp);
// "6.2.9200", and what Windows version that is reported as
std::string OsVersion(const IClientSysInfo::SysInfoRow& row);
std::string OsLabel(const IClientSysInfo::SysInfoRow& row);
// A physical memory bucket by the reported total: "Under 2 GB", "2-4 GB", ... "64 GB or more", "Not read"
std::string MemoryBucket(uint64_t totalKb);
/**
* The spread across players from each account's newest row: {accounts, os: [{label, count}], video: [...],
* memory: [...], processors: [...], clientOs: [...]}, most common first, at most top entries each (the rest are
* one "Other" entry).
*/
nlohmann::json Spread(const std::vector<IClientSysInfo::SysInfoRow>& latest, size_t top = 20);
}