23#include <utils/system/hostinfo.h>
24#include <webview/page_footer_generator.h>
25#include <webview/page_header_generator.h>
26#include <webview/page_reply.h>
42const char *WebPageReply::PAGE_HEADER =
45 " <title>%s</title>\n"
46 " <link rel=\"stylesheet\" type=\"text/css\" href=\"/static/css/webview.css\" />\n"
52const char *WebPageReply::PAGE_FOOTER =
"\n </body>\n"
63 navbar_enabled_ =
true;
64 footer_enabled_ =
true;
75 navbar_enabled_ =
true;
76 footer_enabled_ =
true;
105 if (headergen && navbar_enabled_)
110 if (asprintf(&s, PAGE_HEADER,
_title.c_str(), html_header_.c_str(), hi.
short_name()) != -1) {
116 merged_body_ +=
_body;
118 if (footergen && footer_enabled_)
121 merged_body_ += PAGE_FOOTER;
124std::string::size_type
127 return merged_body_.length();
143 navbar_enabled_ = enabled;
152 return navbar_enabled_;
161 footer_enabled_ = enabled;
170 return footer_enabled_;
const char * short_name()
Get short hostname (up to first dot).
std::string _body
Body of the reply.
void add_header(const std::string &header, const std::string &content)
Add a HTTP header.
Fawkes library namespace.