| 62 | }; |
| 63 | |
| 64 | void VLogService::default_method(::google::protobuf::RpcController* cntl_base, |
| 65 | const ::brpc::VLogRequest*, |
| 66 | ::brpc::VLogResponse*, |
| 67 | ::google::protobuf::Closure* done) { |
| 68 | ClosureGuard done_guard(done); |
| 69 | Controller *cntl = static_cast<Controller*>(cntl_base); |
| 70 | const bool use_html = UseHTML(cntl->http_request()); |
| 71 | butil::IOBufBuilder os; |
| 72 | |
| 73 | cntl->http_response().set_content_type( |
| 74 | use_html ? "text/html" : "text/plain"); |
| 75 | if (use_html) { |
| 76 | os << "<!DOCTYPE html><html><head>" << gridtable_style() |
| 77 | << "<script src=\"/js/sorttable\"></script></head><body>" |
| 78 | "<table class=\"gridtable\" border=\"1\"><tr>" |
| 79 | "<th>Module</th><th>Current</th><th>Required</th>" |
| 80 | "<th>Status</th></tr>\n"; |
| 81 | } else { |
| 82 | os << "Module | Current | Required | Status\n"; |
| 83 | } |
| 84 | VLogPrinter printer(use_html, os); |
| 85 | print_vlog_sites(&printer); |
| 86 | if (use_html) { |
| 87 | os << "</table>\n"; |
| 88 | } |
| 89 | |
| 90 | if (use_html) { |
| 91 | os << "</body></html>\n"; |
| 92 | } |
| 93 | os.move_to(cntl->response_attachment()); |
| 94 | } |
| 95 | |
| 96 | } // namespace brpc |
| 97 |
nothing calls this directly
no test coverage detected