Permalink
Browse files

restyle builtin webserver page

should closely match the powerdns CI, except for the font.
  • Loading branch information...
1 parent e2a77e0 commit 1071abdd53b4a71c0c210a6b4f5aee86a30e6b98 @zeha zeha committed Apr 30, 2013
Showing with 75 additions and 31 deletions.
  1. +3 −3 pdns/webserver.cc
  2. +71 −28 pdns/ws.cc
  3. +1 −0 pdns/ws.hh
View
@@ -143,7 +143,7 @@ void *WebServer::serveConnection(void *p)
client->putLine("WWW-Authenticate: Basic realm=\"PowerDNS\"\n");
client->putLine("Connection: close\n");
- client->putLine("Content-type: text/html\n\n");
+ client->putLine("Content-type: text/html; charset=UTF-8\n\n");
client->putLine("Please enter a valid password!\n");
client->close();
delete client;
@@ -158,14 +158,14 @@ void *WebServer::serveConnection(void *p)
if(!custom) {
client->putLine("HTTP/1.1 200 OK\n");
client->putLine("Connection: close\n");
- client->putLine("Content-type: text/html\n\n");
+ client->putLine("Content-type: text/html; charset=UTF-8\n\n");
}
client->putLine(ret);
}
else {
client->putLine("HTTP/1.1 404 Not found\n");
client->putLine("Connection: close\n");
- client->putLine("Content-type: text/html\n\n");
+ client->putLine("Content-type: text/html; charset=UTF-8\n\n");
// FIXME: CSS problem?
client->putLine("<html><body><h1>Did not find file '"+baseUrl+"'</body></html>\n");
}
View
@@ -95,30 +95,27 @@ void printtable(ostringstream &ret, const string &ringname, const string &title,
int entries=0;
vector<pair <string,unsigned int> >ring=S.getRing(ringname);
- for(vector<pair<string, unsigned int> >::const_iterator i=ring.begin(); i!=ring.end();++i) {
+ for(vector<pair<string, unsigned int> >::const_iterator i=ring.begin(); i!=ring.end();++i) {
tot+=i->second;
entries++;
}
-
- ret<<"<table border=1><tr><td colspan=3 bgcolor=\"#0000ff\">"
- "<a href=\"?ring="<<ringname<<"\"><font color=\"#ffffff\">Top-"<<limit<<" of ";
- ret<<entries<<": "<<title<<"</font></a></td>"<<endl;
-
- ret<<"<tr><td colspan=3><table bgcolor=\"#ff0000\" width=\"100%\"><tr><td align=left>"
- "<a href=\"?resetring="<<ringname<<"\"><font color=\"#ffffff\">Reset</font></a></td>";
- ret<<"<td align=right>Resize: ";
-
+ ret<<"<div class=\"panel\">";
+ ret<<"<span class=resetring><i></i><a href=\"?resetring="<<ringname<<"\">Reset</a></span>"<<endl;
+ ret<<"<h2>"<<title<<"</h2>"<<endl;
+ ret<<"<div class=ringmeta>";
+ ret<<"<a class=topXofY href=\"?ring="<<ringname<<"\">Showing: Top "<<limit<<" of "<<entries<<"</a>"<<endl;
+ ret<<"<span class=resizering>Resize: ";
unsigned int sizes[]={10,100,500,1000,10000,500000,0};
for(int i=0;sizes[i];++i) {
if(S.getRingSize(ringname)!=sizes[i])
ret<<"<a href=\"?resizering="<<ringname<<"&amp;size="<<sizes[i]<<"\">"<<sizes[i]<<"</a> ";
else
ret<<"("<<sizes[i]<<") ";
}
- ret<<"</td></table>"<<endl;
-
+ ret<<"</span></div>";
+ ret<<"<table class=\"data\">";
int printed=0;
for(vector<pair<string,unsigned int> >::const_iterator i=ring.begin();limit && i!=ring.end();++i,--limit) {
ret<<"<tr><td>"<<i->first<<"</td><td>"<<i->second<<"</td><td align=right>"<< StatWebServer::makePercentage(i->second*100.0/tot)<<"</td>"<<endl;
@@ -129,20 +126,19 @@ void printtable(ostringstream &ret, const string &ringname, const string &title,
ret<<"<tr><td><b>Rest:</b></td><td><b>"<<tot-printed<<"</b></td><td align=right><b>"<< StatWebServer::makePercentage((tot-printed)*100.0/tot)<<"</b></td>"<<endl;
ret<<"<tr><td><b>Total:</b></td><td><b>"<<tot<<"</b></td><td align=right><b>100%</b></td>";
- ret<<"</table><br>"<<endl;
+ ret<<"</table></div>"<<endl;
}
void StatWebServer::printvars(ostringstream &ret)
{
- ret<<"<table border=1><tr><td colspan=3 bgcolor=\"#0000ff\"><font color=\"#ffffff\">Variables</font></td>"<<endl;
-
+ ret<<"<div class=panel><h2>Variables</h2><table class=\"data\">"<<endl;
vector<string>entries=S.getEntries();
for(vector<string>::const_iterator i=entries.begin();i!=entries.end();++i) {
ret<<"<tr><td>"<<*i<<"</td><td>"<<S.read(*i)<<"</td><td>"<<S.getDescrip(*i)<<"</td>"<<endl;
}
- ret<<"</table>"<<endl;
+ ret<<"</table></div>"<<endl;
}
void StatWebServer::printargs(ostringstream &ret)
@@ -177,17 +173,21 @@ string StatWebServer::indexfunction(const string& method, const string& post, co
ostringstream ret;
- ret<<"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"<<endl;
- ret<<"<html><head><title>PowerDNS Operational Monitor</title></head><body bgcolor=\"#ffffff\">"<<endl;
-
-
- ret<<"<h2>";
- if(!arg()["config-name"].empty())
- ret<<"["<<arg()["config-name"]<<"]";
- if(rvarmap["ring"].empty())
- ret<<"PDNS "VERSION" Main Page</h2>"<<endl;
- else
- ret<<"Details page</h2><a href=\"/\">Back to main page</a>"<<endl;
+ ret<<"<!DOCTYPE html>"<<endl;
+ ret<<"<html><head>"<<endl;
+ ret<<"<title>PowerDNS Authoritative Server Monitor</title>"<<endl;
+ ret<<"<link rel=\"stylesheet\" href=\"style.css\"/>"<<endl;
+ ret<<"</head><body>"<<endl;
+
+ ret<<"<div class=\"row\">"<<endl;
+ ret<<"<div class=\"headl columns\">";
+ ret<<"<a href=\"/\" id=\"appname\">PowerDNS "VERSION;
+ if(!arg()["config-name"].empty()) {
+ ret<<" ["<<arg()["config-name"]<<"]";
+ }
+ ret<<"</a></div>"<<endl;
+ ret<<"<div class=\"headr columns\"></div></div>";
+ ret<<"<div class=\"row\"><div class=\"all columns\">";
time_t passed=time(0)-s_starttime;
@@ -221,7 +221,7 @@ string StatWebServer::indexfunction(const string& method, const string& post, co
sws->d_qcachemisses.get10()<<". Max queries/second: "<<sws->d_qcachemisses.getMax()<<
"<br>"<<endl;
- ret<<"Total queries: "<<S.read("udp-queries")<<". Question/answer latency: "<<S.read("latency")/1000.0<<"ms</p>"<<endl;
+ ret<<"Total queries: "<<S.read("udp-queries")<<". Question/answer latency: "<<S.read("latency")/1000.0<<"ms</p><br>"<<endl;
if(rvarmap["ring"].empty()) {
vector<string>entries=S.listRings();
for(vector<string>::const_iterator i=entries.begin();i!=entries.end();++i)
@@ -234,6 +234,8 @@ string StatWebServer::indexfunction(const string& method, const string& post, co
else
printtable(ret,rvarmap["ring"],S.getRingTitle(rvarmap["ring"]),100);
+ ret<<"</div></div>"<<endl;
+ ret<<"<footer class=\"row\">PowerDNS Authoritative Server "VERSION". &copy; 2013 <a href=\"http://www.powerdns.com/\">PowerDNS.COM BV</a>.</footer>"<<endl;
ret<<"</body></html>"<<endl;
return ret.str();
@@ -518,11 +520,52 @@ string StatWebServer::jsonstat(const string& method, const string& post, const m
return ret;
}
+string StatWebServer::cssfunction(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom)
+{
+ *custom=1; // indicates we build the response
+ ostringstream ret;
+ ret<<"HTTP/1.1 200 OK\r\n"
+ "Server: PowerDNS/"VERSION"\r\n"
+ "Connection: close\r\n"
+ "Cache-Control: max-age=86400\r\n"
+ "Content-Type: text/css\r\n"
+ "\r\n";
+
+ ret<<"* { box-sizing: border-box; margin: 0; padding: 0; }"<<endl;
+ ret<<"body { color: black; background: white; margin-top: 1em; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 10pt; position: relative; }"<<endl;
+ ret<<"a { color: #0959c2; }"<<endl;
+ ret<<"a:hover { color: #3B8EC8; }"<<endl;
+ ret<<".row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }"<<endl;
+ ret<<".row:before, .row:after { display: table; content:\" \"; }"<<endl;
+ ret<<".row:after { clear: both; }"<<endl;
+ ret<<".columns { position: relative; min-height: 1px; float: left; }"<<endl;
+ ret<<".all { width: 100%; }"<<endl;
+ ret<<".headl { width: 60%; }"<<endl;
+ ret<<".headr { width: 39.5%; float: right; background-repeat: no-repeat; margin-top: 7px; ";
+ ret<<"background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJoA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qqur4xs2bAgL+XQSiYTJvZcf9Njt9uRdd90Vys2PcQnd5ubmAMMwcPPmTXk0GhUDpCsRVVVVsccee2yBS0PxIZLqacszfZPBP7+qj4+1Kilf+lNuYtkDEU3La3mfcmsfPL4gqfxFrJxPuYll22Kmp/omgpf+zZia7ZEyCT+KGVcn5WsP+uUNh0IAAP8PaQRnE4MgdzkAAAAASUVORK5CYII=);";
+ ret<<" width: 154px; height: 20px; }"<<endl;
+ ret<<"a#appname { margin: 0; font-size: 27px; color: #666; text-decoration: none; font-weight: bold; display: block; }"<<endl;
+ ret<<"footer { border-top: 1px solid #ddd; padding-top: 4px; font-size: 12px; }"<<endl;
+ ret<<"footer.row { margin-top: 1em; margin-bottom: 1em; }"<<endl;
+ ret<<".panel { background: #f2f2f2; border: 1px solid #e6e6e6; margin: 0 0 22px 0; padding: 20px; }"<<endl;
+ ret<<"table.data { width: 100%; border-spacing: 0; border-top: 1px solid #333; }"<<endl;
+ ret<<"table.data td { border-bottom: 1px solid #333; padding: 2px; }"<<endl;
+ ret<<"table.data tr:nth-child(2n) { background: #e2e2e2; }"<<endl;
+ ret<<"table.data tr:hover { background: white; }"<<endl;
+ ret<<".ringmeta { margin-bottom: 5px; }"<<endl;
+ ret<<".resetring {float: right; }"<<endl;
+ ret<<".resetring i { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAA/klEQVQY01XPP04UUBgE8N/33vd2XZUWEuzYuMZEG4KFCQn2NhA4AIewAOMBPIG2xhNYeAcKGqkNCdmYlVBZGBIT4FHsbuE0U8xk/kAbqm9TOfI/nicfhmwgDNhvylUT58kxCp4l31L8SfH9IetJ2ev6PwyIwyZWsdb11/gbTK55Co+r8rmJaRPTFJcpZil+pTit7C5awMpA+Zpi1sRFE9MqflYOloYCjY2uP8EdYiGU4CVGUBubxKfOOLjrtOBmzvEilbVb/aQWvhRl0unBZVXe4XdnK+bprwqnhoyTsyZ+JG8Wk0apfExxlcp7PFruXH8gdxamWB4cyW2sIO4BG3czIp78jUIAAAAASUVORK5CYII=); width: 10px; height: 10px; margin-right: 2px; display: inline-block; background-repeat: no-repeat; }"<<endl;
+ ret<<".resetring:hover i { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAA2ElEQVQY013PMUoDcRDF4c+kEzxCsNNCrBQvIGhnlcYm11EkBxAraw8gglgIoiJpAoKIYlBcgrgopsma3c3fwt1k9cHA480M8xvQp/nMjorOWY5ov7IAYlpjQk7aYxcuWBpwFQgJnUcaYk7GhEDIGL5w+MVpKLIRyR2b4JOjvGhUKzHTv2W7iuSN479Dvu9plf1awbQ6y3x1sU5tjpVJcMbakF6Ycoas8Dl5xEHJ160wRdfqzXfa6XQ4PLDlicWUjxHxZfndL/N+RhiwNzl/Q6PDhn/qsl76H7prcApk2B1aAAAAAElFTkSuQmCC);}"<<endl;
+ ret<<".resizering {float: right;}"<<endl;
+ return ret.str();
+}
+
void StatWebServer::launch()
{
try {
d_ws->setCaller(this);
d_ws->registerHandler("",&indexfunction);
+ d_ws->registerHandler("style.css",&cssfunction);
if(::arg().mustDo("experimental-json-interface"))
d_ws->registerHandler("jsonstat", &jsonstat);
d_ws->go();
View
@@ -87,6 +87,7 @@ private:
static void *threadHelper(void *);
static void *statThreadHelper(void *p);
static string indexfunction(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom);
+ static string cssfunction(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom);
static string jsonstat(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom);
void printvars(ostringstream &ret);
void printargs(ostringstream &ret);

0 comments on commit 1071abd

Please sign in to comment.