chức năng dashboard

This commit is contained in:
2026-06-13 13:20:57 +07:00
parent c116b30bea
commit 6f6d925fdd
9 changed files with 746 additions and 167 deletions

View File

@@ -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