diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/monlib/service/pages/html_mon_page.cpp | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/monlib/service/pages/html_mon_page.cpp')
-rw-r--r-- | library/cpp/monlib/service/pages/html_mon_page.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/library/cpp/monlib/service/pages/html_mon_page.cpp b/library/cpp/monlib/service/pages/html_mon_page.cpp new file mode 100644 index 0000000000..eb4eb3b66c --- /dev/null +++ b/library/cpp/monlib/service/pages/html_mon_page.cpp @@ -0,0 +1,60 @@ +#include "html_mon_page.h" + +#include <library/cpp/monlib/service/pages/templates.h> + +using namespace NMonitoring; + +void THtmlMonPage::Output(NMonitoring::IMonHttpRequest& request) { + IOutputStream& out = request.Output(); + + out << HTTPOKHTML; + HTML(out) { + out << "<!DOCTYPE html>\n"; + HTML_TAG() { + HEAD() { + if (!!Title) { + out << "<title>" << Title << "</title>\n"; + } + out << "<link rel='stylesheet' href='https://yastatic.net/bootstrap/3.3.1/css/bootstrap.min.css'>\n"; + out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/jquery/2.1.3/jquery.min.js'></script>\n"; + out << "<script language='javascript' type='text/javascript' src='https://yastatic.net/bootstrap/3.3.1/js/bootstrap.min.js'></script>\n"; + + if (OutputTableSorterJsCss) { + out << "<link rel='stylesheet' href='/jquery.tablesorter.css'>\n"; + out << "<script language='javascript' type='text/javascript' src='/jquery.tablesorter.js'></script>\n"; + } + + out << "<style type=\"text/css\">\n"; + out << ".table-nonfluid { width: auto; }\n"; + out << ".narrow-line50 {line-height: 50%}\n"; + out << ".narrow-line60 {line-height: 60%}\n"; + out << ".narrow-line70 {line-height: 70%}\n"; + out << ".narrow-line80 {line-height: 80%}\n"; + out << ".narrow-line90 {line-height: 90%}\n"; + out << "</style>\n"; + } + BODY() { + OutputNavBar(out); + + DIV_CLASS("container") { + if (!!Title) { + out << "<h2>" << Title << "</h2>"; + } + OutputContent(request); + } + } + } + } +} + +void THtmlMonPage::NotFound(NMonitoring::IMonHttpRequest& request) const { + IOutputStream& out = request.Output(); + out << HTTPNOTFOUND; + out.Flush(); +} + +void THtmlMonPage::NoContent(NMonitoring::IMonHttpRequest& request) const { + IOutputStream& out = request.Output(); + out << HTTPNOCONTENT; + out.Flush(); +} |