mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-23 14:33:07 +00:00
feat(dashboard): /api/ugc/:id/runs lists a model's makes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -457,6 +457,21 @@ namespace UgcRoutes {
|
|||||||
reply.message = sd0.GetAsStringUncompressed();
|
reply.message = sd0.GetAsStringUncompressed();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route(eHTTPMethod::GET, "/api/ugc/:id/runs", Perm("properties_view"),
|
||||||
|
"A player model's makes, the newest first (at most 50): madeAt (unix seconds), options (what made it), ms, cpuMs, hsrMs, aoMs, iconMs, "
|
||||||
|
"bricks, trianglesBefore, triangles",
|
||||||
|
[](HTTPReply& reply, const HTTPContext& context) {
|
||||||
|
const auto id = PathId<LWOOBJID>(context.path, 2);
|
||||||
|
if (!id) return JsonError(reply, eHTTPStatusCode::BAD_REQUEST, "Invalid id");
|
||||||
|
nlohmann::json runs = nlohmann::json::array();
|
||||||
|
for (const auto& [madeAt, run] : Database::Get()->GetUgcModelRuns(*id, 50)) {
|
||||||
|
runs.push_back({ { "madeAt", madeAt }, { "options", run.options }, { "ms", run.milliseconds }, { "cpuMs", run.cpuMilliseconds },
|
||||||
|
{ "hsrMs", run.hsrMilliseconds }, { "aoMs", run.aoMilliseconds }, { "iconMs", run.iconMilliseconds }, { "bricks", run.bricks },
|
||||||
|
{ "trianglesBefore", run.trianglesBefore }, { "triangles", run.triangles } });
|
||||||
|
}
|
||||||
|
JsonSuccess(reply, { { "runs", runs } });
|
||||||
|
});
|
||||||
|
|
||||||
Route(eHTTPMethod::GET, "/api/ugc/options", Perm("properties_view"),
|
Route(eHTTPMethod::GET, "/api/ugc/options", Perm("properties_view"),
|
||||||
"The processing options (docs/UgcServer.md, \"Processing options\"): the choices ({rays, denoise, processor}: names), the settings' defaults "
|
"The processing options (docs/UgcServer.md, \"Processing options\"): the choices ({rays, denoise, processor}: names), the settings' defaults "
|
||||||
"({rays, denoise, processor}) and every combination the made models used, with its makes (runs), models and averages per make "
|
"({rays, denoise, processor}) and every combination the made models used, with its makes (runs), models and averages per make "
|
||||||
|
|||||||
Reference in New Issue
Block a user