chức năng dashboard
This commit is contained in:
@@ -502,6 +502,24 @@ void ApiServer::registerRoutes(httplib::Server& svr)
|
||||
return HttpUtil::jsonError(res, 400, err);
|
||||
res.status = 204;
|
||||
});
|
||||
|
||||
svr.Post("/api/mission_queue/pause", [this](const httplib::Request&, httplib::Response& res) {
|
||||
HttpUtil::addCors(res);
|
||||
std::string err;
|
||||
if (!mission_queue_.pause(err))
|
||||
return HttpUtil::jsonError(res, 400, err);
|
||||
res.set_header("Content-Type", "application/json; charset=utf-8");
|
||||
res.body = mission_queue_.runnerStatus().dump();
|
||||
});
|
||||
|
||||
svr.Post("/api/mission_queue/continue", [this](const httplib::Request&, httplib::Response& res) {
|
||||
HttpUtil::addCors(res);
|
||||
std::string err;
|
||||
if (!mission_queue_.resume(err))
|
||||
return HttpUtil::jsonError(res, 400, err);
|
||||
res.set_header("Content-Type", "application/json; charset=utf-8");
|
||||
res.body = mission_queue_.runnerStatus().dump();
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace lm
|
||||
|
||||
Reference in New Issue
Block a user