Added /reloadrules to web interface
This commit is contained in:
parent
896eec33f2
commit
88a7e3b295
@ -128,3 +128,18 @@ void World::Web_worldhandle_setadminstatus(const http::request<http::string_body
|
||||
res.body() = json;
|
||||
res.prepare_payload();
|
||||
}
|
||||
|
||||
void World::Web_worldhandle_reloadrules(const http::request<http::string_body>& req, http::response<http::string_body>& res) {
|
||||
res.set(http::field::content_type, "application/json");
|
||||
boost::property_tree::ptree pt, json_tree;
|
||||
|
||||
database.LoadRuleSets(true);
|
||||
|
||||
pt.put("success", 1);
|
||||
|
||||
std::ostringstream oss;
|
||||
boost::property_tree::write_json(oss, pt);
|
||||
std::string json = oss.str();
|
||||
res.body() = json;
|
||||
res.prepare_payload();
|
||||
}
|
@ -246,6 +246,7 @@ void World::init(std::string web_ipaddr, int16 web_port, std::string cert_file,
|
||||
world_webserver->register_route("/status", World::Web_worldhandle_status);
|
||||
world_webserver->register_route("/clients", World::Web_worldhandle_clients);
|
||||
world_webserver->register_route("/setadminstatus", World::Web_worldhandle_setadminstatus);
|
||||
world_webserver->register_route("/reloadrules", World::Web_worldhandle_reloadrules);
|
||||
world_webserver->run();
|
||||
LogWrite(INIT__INFO, 0, "Init", "World Web Server is listening on %s:%u..", web_ipaddr.c_str(), web_port);
|
||||
}
|
||||
|
@ -652,6 +652,7 @@ public:
|
||||
static void Web_worldhandle_status(const http::request<http::string_body>& req, http::response<http::string_body>& res);
|
||||
static void Web_worldhandle_clients(const http::request<http::string_body>& req, http::response<http::string_body>& res);
|
||||
static void Web_worldhandle_setadminstatus(const http::request<http::string_body>& req, http::response<http::string_body>& res);
|
||||
static void Web_worldhandle_reloadrules(const http::request<http::string_body>& req, http::response<http::string_body>& res);
|
||||
|
||||
Mutex MVoiceOvers;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user