фича: маска для сети управления + исправление багов на странице для разработчиков

This commit is contained in:
2025-06-05 17:07:27 +03:00
parent 996e711436
commit 9fbe88b64d
12 changed files with 127 additions and 92 deletions

View File

@@ -595,6 +595,8 @@ public:
}));
#ifdef API_OBJECT_DEBUG_METRICS_ENABLE
s.resources.emplace_back(std::make_unique<http::auth::AuthRequiredResource>("/dev/settings", this->auth, http::auth::User::DEVELOPER, [this](const auto& req, auto& rep) {
rep.status = http::server::ok;
rep.headers.push_back({.name = "Content-Type", .value = toString(mime_types::text_plain)});
nlohmann::json resultJson;
try {
@@ -603,7 +605,7 @@ public:
resultJson["logstat"] = api->getLoggingStatisticsSettings();
} else if (req.method == "POST") {
auto reqJson = nlohmann::json::parse(std::string(req.payload.begin(), req.payload.end()));
api->setQosSettings(reqJson);
api->setLoggingStatisticsSettings(reqJson);
resultJson["status"] = "ok";
resultJson["logstat"] = api->getLoggingStatisticsSettings();