фича: маска для сети управления + исправление багов на странице для разработчиков
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user