html_mon_page.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #include "html_mon_page.h"
  2. #include <library/cpp/monlib/service/pages/templates.h>
  3. using namespace NMonitoring;
  4. void THtmlMonPage::Output(NMonitoring::IMonHttpRequest& request) {
  5. IOutputStream& out = request.Output();
  6. out << HTTPOKHTML;
  7. HTML(out) {
  8. out << "<!DOCTYPE html>\n";
  9. HTML_TAG() {
  10. HEAD() {
  11. if (!!Title) {
  12. out << "<title>" << Title << "</title>\n";
  13. }
  14. out << "<link rel='stylesheet' href='/static/css/bootstrap.min.css'>\n";
  15. out << "<script language='javascript' type='text/javascript' src='/static/js/jquery.min.js'></script>\n";
  16. out << "<script language='javascript' type='text/javascript' src='/static/js/bootstrap.min.js'></script>\n";
  17. if (OutputTableSorterJsCss) {
  18. out << "<link rel='stylesheet' href='/jquery.tablesorter.css'>\n";
  19. out << "<script language='javascript' type='text/javascript' src='/jquery.tablesorter.js'></script>\n";
  20. }
  21. out << "<style type=\"text/css\">\n";
  22. out << ".table-nonfluid { width: auto; }\n";
  23. out << ".narrow-line50 {line-height: 50%}\n";
  24. out << ".narrow-line60 {line-height: 60%}\n";
  25. out << ".narrow-line70 {line-height: 70%}\n";
  26. out << ".narrow-line80 {line-height: 80%}\n";
  27. out << ".narrow-line90 {line-height: 90%}\n";
  28. out << "</style>\n";
  29. }
  30. BODY() {
  31. OutputNavBar(out);
  32. DIV_CLASS("container") {
  33. if (!!Title) {
  34. out << "<h2>" << Title << "</h2>";
  35. }
  36. OutputContent(request);
  37. }
  38. }
  39. }
  40. }
  41. }
  42. void THtmlMonPage::NotFound(NMonitoring::IMonHttpRequest& request) const {
  43. IOutputStream& out = request.Output();
  44. out << HTTPNOTFOUND;
  45. out.Flush();
  46. }
  47. void THtmlMonPage::NoContent(NMonitoring::IMonHttpRequest& request) const {
  48. IOutputStream& out = request.Output();
  49. out << HTTPNOCONTENT;
  50. out.Flush();
  51. }