mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-14 16:44:09 +00:00
feat(dashboard): UGC list shows a model's given name, and Took/CPU/RAM columns
The models list's Took, CPU and RAM (est.) are separate columns, each sortable (sort=slowest|cpu|memory). The File column shows the name a player gave the model where it is placed, with the upload's extension (the upload's file name is its tooltip), and the name sort uses it (case-insensitive, so SQLite and MySQL agree). The config layer test no longer assumes the build's sharedconfig.ini has no mysql_host; it checks that the database-supplied value isn't used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,7 @@ TEST(ConfigLayerTests, DatabaseValuesLayerAroundFilesAndEnvironment) {
|
||||
config.SetDatabaseValues({ { "zz_override", "web" }, { "mysql_host", "evil" } }, { { "zz_fallback", "web" }, { "zz_both", "web" } });
|
||||
EXPECT_EQ(config.GetValue("zz_override"), "web");
|
||||
EXPECT_EQ(config.GetValue("zz_fallback"), "web");
|
||||
EXPECT_EQ(config.GetValue("mysql_host"), ""); // connection settings never come from the database
|
||||
EXPECT_NE(config.GetValue("mysql_host"), "evil"); // connection settings never come from the database (the build's own sharedconfig.ini may set one)
|
||||
EXPECT_EQ(config.GetValue("zz_missing"), "");
|
||||
|
||||
// The environment beats a fallback but not an override
|
||||
|
||||
@@ -173,15 +173,19 @@ TEST_F(UgcLookupSqlTests, ListsPagesWithCounts) {
|
||||
query.reverse = true; // the fewest bricks first
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1001, 1000 }));
|
||||
query.reverse = false;
|
||||
query.sort = IUgcLookup::eSort::NAME; // boat before tower
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1001, 1000 }));
|
||||
query.reverse = true; // tower before boat
|
||||
query.sort = IUgcLookup::eSort::NAME; // "Big tower" (its placed name) before boat.lxfml, whatever the case
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1000, 1001 }));
|
||||
query.reverse = true;
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1001, 1000 }));
|
||||
query.reverse = false;
|
||||
query.sort = IUgcLookup::eSort::NEWEST;
|
||||
query.reverse = true; // the oldest first
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1000, 1001 }));
|
||||
query.reverse = false;
|
||||
query.sort = IUgcLookup::eSort::CPU; // none recorded: ties go newest first
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1001, 1000 }));
|
||||
query.sort = IUgcLookup::eSort::MEMORY;
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1001, 1000 }));
|
||||
query.sort = IUgcLookup::eSort::MADE; // neither has been made: ties go newest first
|
||||
EXPECT_EQ(List(query, false).first, (std::vector<int64_t>{ 1001, 1000 }));
|
||||
query.sort = IUgcLookup::eSort::SLOWEST; // the tower took 5.2 s; the boat isn't made
|
||||
@@ -193,7 +197,7 @@ TEST_F(UgcLookupSqlTests, ListsPagesWithCounts) {
|
||||
query.limit = 1;
|
||||
query.offset = 1;
|
||||
std::tie(ids, total) = List(query, false);
|
||||
EXPECT_EQ(ids, (std::vector<int64_t>{ 1000 }));
|
||||
EXPECT_EQ(ids, (std::vector<int64_t>{ 1001 }));
|
||||
EXPECT_EQ(total, 2); // the count is of every match, not the page
|
||||
query = {};
|
||||
query.state = IUgc::eProcessState::DONE;
|
||||
|
||||
Reference in New Issue
Block a user