feat(dashboard): UGC list sorts by when a model was made and by how long it took

The models list has separate Made (when) and Took (the time, CPU and
estimated memory) columns, each sortable in either direction; /api/ugc
takes sort=made (processed_at) besides sort=slowest, and the gallery can
sort by recently made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 20:51:21 -05:00
parent 56c3a81db2
commit 264abfc0f3
6 changed files with 10 additions and 5 deletions

View File

@@ -64,6 +64,7 @@ public:
BRICKS, // models: the most bricks first
TRIANGLES, // models: the most triangles first
SLOWEST, // the longest last make first (process_ms)
MADE, // the most recently made (or attempted) first (processed_at)
};
// A page of one kind: all of them or those matching the search (the same matching as SearchUgc), in a state or any

View File

@@ -58,6 +58,7 @@ namespace UgcLookupSql {
case eSort::NAME: return std::string("ORDER BY ") + (modular ? "b.ldf_config" : "u.filename") + dir(false) + ", " + id + " DESC ";
case eSort::BRICKS: return modular ? "ORDER BY " + id + dir(true) + " " : "ORDER BY u.brick_count" + std::string(dir(true)) + ", u.id DESC ";
case eSort::TRIANGLES: return modular ? "ORDER BY " + id + dir(true) + " " : "ORDER BY u.triangle_count" + std::string(dir(true)) + ", u.id DESC ";
case eSort::MADE: return "ORDER BY " + std::string(modular ? "b" : "u") + ".processed_at" + dir(true) + ", " + id + " DESC ";
case eSort::SLOWEST: return "ORDER BY " + std::string(modular ? "b" : "u") + ".process_ms" + dir(true) + ", " + id + " DESC ";
default: return "ORDER BY " + id + dir(true) + " ";
}