mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-19 19:22:49 +00:00
feat(dashboard): show the UGC server on the home page and Server Health
Server Status gets a UGC row while master starts it, and staff with health_view a UGC Server card: up time, waiting/made/failed, busy workers and storage, linking to /ugc. Server Health adds UGC to the uptime history and a Servers table with every server's process, memory, CPU and last report. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,6 +81,12 @@ namespace {
|
||||
pid = ServerState::g_UgcPid;
|
||||
}
|
||||
out["pid"] = pid;
|
||||
// Up since its process started when this machine runs it (the dashboard may have started after it)
|
||||
if (pid && out.value("online", false)) {
|
||||
for (const auto& process : ServerRoutes::Processes()) {
|
||||
if (process.pid == pid && process.startedAt) out["since"] = process.startedAt;
|
||||
}
|
||||
}
|
||||
// Its traffic report (every few seconds, via master) carries its workers, totals and storage
|
||||
const auto traffic = Traffic::Server("ugc");
|
||||
out["gauges"] = traffic.value("gauges", nlohmann::json::object());
|
||||
|
||||
Reference in New Issue
Block a user