Skip to content

Commit 1071abd

Browse files
committed
restyle builtin webserver page
should closely match the powerdns CI, except for the font.
1 parent e2a77e0 commit 1071abd

File tree

3 files changed

+75
-31
lines changed

3 files changed

+75
-31
lines changed

pdns/webserver.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void *WebServer::serveConnection(void *p)
143143
client->putLine("WWW-Authenticate: Basic realm=\"PowerDNS\"\n");
144144

145145
client->putLine("Connection: close\n");
146-
client->putLine("Content-type: text/html\n\n");
146+
client->putLine("Content-type: text/html; charset=UTF-8\n\n");
147147
client->putLine("Please enter a valid password!\n");
148148
client->close();
149149
delete client;
@@ -158,14 +158,14 @@ void *WebServer::serveConnection(void *p)
158158
if(!custom) {
159159
client->putLine("HTTP/1.1 200 OK\n");
160160
client->putLine("Connection: close\n");
161-
client->putLine("Content-type: text/html\n\n");
161+
client->putLine("Content-type: text/html; charset=UTF-8\n\n");
162162
}
163163
client->putLine(ret);
164164
}
165165
else {
166166
client->putLine("HTTP/1.1 404 Not found\n");
167167
client->putLine("Connection: close\n");
168-
client->putLine("Content-type: text/html\n\n");
168+
client->putLine("Content-type: text/html; charset=UTF-8\n\n");
169169
// FIXME: CSS problem?
170170
client->putLine("<html><body><h1>Did not find file '"+baseUrl+"'</body></html>\n");
171171
}

pdns/ws.cc

Lines changed: 71 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,30 +95,27 @@ void printtable(ostringstream &ret, const string &ringname, const string &title,
9595
int entries=0;
9696
vector<pair <string,unsigned int> >ring=S.getRing(ringname);
9797

98-
for(vector<pair<string, unsigned int> >::const_iterator i=ring.begin(); i!=ring.end();++i) {
98+
for(vector<pair<string, unsigned int> >::const_iterator i=ring.begin(); i!=ring.end();++i) {
9999
tot+=i->second;
100100
entries++;
101101
}
102102

103-
104-
ret<<"<table border=1><tr><td colspan=3 bgcolor=\"#0000ff\">"
105-
"<a href=\"?ring="<<ringname<<"\"><font color=\"#ffffff\">Top-"<<limit<<" of ";
106-
ret<<entries<<": "<<title<<"</font></a></td>"<<endl;
107-
108-
ret<<"<tr><td colspan=3><table bgcolor=\"#ff0000\" width=\"100%\"><tr><td align=left>"
109-
"<a href=\"?resetring="<<ringname<<"\"><font color=\"#ffffff\">Reset</font></a></td>";
110-
ret<<"<td align=right>Resize: ";
111-
103+
ret<<"<div class=\"panel\">";
104+
ret<<"<span class=resetring><i></i><a href=\"?resetring="<<ringname<<"\">Reset</a></span>"<<endl;
105+
ret<<"<h2>"<<title<<"</h2>"<<endl;
106+
ret<<"<div class=ringmeta>";
107+
ret<<"<a class=topXofY href=\"?ring="<<ringname<<"\">Showing: Top "<<limit<<" of "<<entries<<"</a>"<<endl;
108+
ret<<"<span class=resizering>Resize: ";
112109
unsigned int sizes[]={10,100,500,1000,10000,500000,0};
113110
for(int i=0;sizes[i];++i) {
114111
if(S.getRingSize(ringname)!=sizes[i])
115112
ret<<"<a href=\"?resizering="<<ringname<<"&amp;size="<<sizes[i]<<"\">"<<sizes[i]<<"</a> ";
116113
else
117114
ret<<"("<<sizes[i]<<") ";
118115
}
119-
ret<<"</td></table>"<<endl;
120-
116+
ret<<"</span></div>";
121117

118+
ret<<"<table class=\"data\">";
122119
int printed=0;
123120
for(vector<pair<string,unsigned int> >::const_iterator i=ring.begin();limit && i!=ring.end();++i,--limit) {
124121
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,
129126
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;
130127

131128
ret<<"<tr><td><b>Total:</b></td><td><b>"<<tot<<"</b></td><td align=right><b>100%</b></td>";
132-
ret<<"</table><br>"<<endl;
129+
ret<<"</table></div>"<<endl;
133130
}
134131

135132
void StatWebServer::printvars(ostringstream &ret)
136133
{
137-
ret<<"<table border=1><tr><td colspan=3 bgcolor=\"#0000ff\"><font color=\"#ffffff\">Variables</font></td>"<<endl;
138-
134+
ret<<"<div class=panel><h2>Variables</h2><table class=\"data\">"<<endl;
139135

140136
vector<string>entries=S.getEntries();
141137
for(vector<string>::const_iterator i=entries.begin();i!=entries.end();++i) {
142138
ret<<"<tr><td>"<<*i<<"</td><td>"<<S.read(*i)<<"</td><td>"<<S.getDescrip(*i)<<"</td>"<<endl;
143139
}
144140

145-
ret<<"</table>"<<endl;
141+
ret<<"</table></div>"<<endl;
146142
}
147143

148144
void StatWebServer::printargs(ostringstream &ret)
@@ -177,17 +173,21 @@ string StatWebServer::indexfunction(const string& method, const string& post, co
177173

178174
ostringstream ret;
179175

180-
ret<<"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"<<endl;
181-
ret<<"<html><head><title>PowerDNS Operational Monitor</title></head><body bgcolor=\"#ffffff\">"<<endl;
182-
183-
184-
ret<<"<h2>";
185-
if(!arg()["config-name"].empty())
186-
ret<<"["<<arg()["config-name"]<<"]";
187-
if(rvarmap["ring"].empty())
188-
ret<<"PDNS "VERSION" Main Page</h2>"<<endl;
189-
else
190-
ret<<"Details page</h2><a href=\"/\">Back to main page</a>"<<endl;
176+
ret<<"<!DOCTYPE html>"<<endl;
177+
ret<<"<html><head>"<<endl;
178+
ret<<"<title>PowerDNS Authoritative Server Monitor</title>"<<endl;
179+
ret<<"<link rel=\"stylesheet\" href=\"style.css\"/>"<<endl;
180+
ret<<"</head><body>"<<endl;
181+
182+
ret<<"<div class=\"row\">"<<endl;
183+
ret<<"<div class=\"headl columns\">";
184+
ret<<"<a href=\"/\" id=\"appname\">PowerDNS "VERSION;
185+
if(!arg()["config-name"].empty()) {
186+
ret<<" ["<<arg()["config-name"]<<"]";
187+
}
188+
ret<<"</a></div>"<<endl;
189+
ret<<"<div class=\"headr columns\"></div></div>";
190+
ret<<"<div class=\"row\"><div class=\"all columns\">";
191191

192192
time_t passed=time(0)-s_starttime;
193193

@@ -221,7 +221,7 @@ string StatWebServer::indexfunction(const string& method, const string& post, co
221221
sws->d_qcachemisses.get10()<<". Max queries/second: "<<sws->d_qcachemisses.getMax()<<
222222
"<br>"<<endl;
223223

224-
ret<<"Total queries: "<<S.read("udp-queries")<<". Question/answer latency: "<<S.read("latency")/1000.0<<"ms</p>"<<endl;
224+
ret<<"Total queries: "<<S.read("udp-queries")<<". Question/answer latency: "<<S.read("latency")/1000.0<<"ms</p><br>"<<endl;
225225
if(rvarmap["ring"].empty()) {
226226
vector<string>entries=S.listRings();
227227
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
234234
else
235235
printtable(ret,rvarmap["ring"],S.getRingTitle(rvarmap["ring"]),100);
236236

237+
ret<<"</div></div>"<<endl;
238+
ret<<"<footer class=\"row\">PowerDNS Authoritative Server "VERSION". &copy; 2013 <a href=\"http://www.powerdns.com/\">PowerDNS.COM BV</a>.</footer>"<<endl;
237239
ret<<"</body></html>"<<endl;
238240

239241
return ret.str();
@@ -518,11 +520,52 @@ string StatWebServer::jsonstat(const string& method, const string& post, const m
518520
return ret;
519521
}
520522

523+
string StatWebServer::cssfunction(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom)
524+
{
525+
*custom=1; // indicates we build the response
526+
ostringstream ret;
527+
ret<<"HTTP/1.1 200 OK\r\n"
528+
"Server: PowerDNS/"VERSION"\r\n"
529+
"Connection: close\r\n"
530+
"Cache-Control: max-age=86400\r\n"
531+
"Content-Type: text/css\r\n"
532+
"\r\n";
533+
534+
ret<<"* { box-sizing: border-box; margin: 0; padding: 0; }"<<endl;
535+
ret<<"body { color: black; background: white; margin-top: 1em; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 10pt; position: relative; }"<<endl;
536+
ret<<"a { color: #0959c2; }"<<endl;
537+
ret<<"a:hover { color: #3B8EC8; }"<<endl;
538+
ret<<".row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }"<<endl;
539+
ret<<".row:before, .row:after { display: table; content:\" \"; }"<<endl;
540+
ret<<".row:after { clear: both; }"<<endl;
541+
ret<<".columns { position: relative; min-height: 1px; float: left; }"<<endl;
542+
ret<<".all { width: 100%; }"<<endl;
543+
ret<<".headl { width: 60%; }"<<endl;
544+
ret<<".headr { width: 39.5%; float: right; background-repeat: no-repeat; margin-top: 7px; ";
545+
ret<<"background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJoAAAAUCAYAAAB1RSS/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACtgAAArYBAHIqtQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABBTSURBVGiBtVp7cFRVmv9u3763b7/f9It00iFACBohgCEyQYgKI49CLV3cWaoEZBcfo2shu7KOtZbjrqOuVQtVWFuOrPqPRU3NgOIDlkgyJEYJwUAqjzEJedFJupN0p9/v+9o/mtve7r790HF+VbeSPue7555zz+98z4ucOXNmgWVZBH4AK5PJGIPBQBqNxpTNZkthGMZCCUxMTBCDg4PyiYkJWTQaRc1mc7Kuri7a1NQU4ssxDAOffPKJAQCynvnII494ESTddO3aNaXT6SS4TplMRj/44IM+7ndXV5dqfn5ewh9306ZNQZqmobu7W11qri0tLX6tVkv19vYqpqampPw+BEFYtVpNGQwG0mKxpJYsWUIKjTE6OiodGBhQ8NcgkUgYjUZDORyOhM1mSxV6fjAYFF+6dEnLb9NoNOR9990X4H53dHSovV4vzpfZvn27T6FQ0Py2sbExorOzU+N2uwmWZUGv15N33nlnuLGxMZy7byyVQEJ//nd9Yuz/lJR/HBdrHSlJ9baIuuV1L4LJ8/Y49pc/KcJX39WRC4MEgskY3Lourmn5rQdbckfe2ijfOBZo+40xNXtNysR9KLZkdVK+9oBf0fBkCABA3Nra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3TCZTQTOkUqnII0eO3FqxYoUgoYRKVQAA/ISl0Ph/60+Dmpqa8syky+Ui+vr6yv4uTavVks8///ytUsV0oWf/GHk+pFIp/cQTT8zqdLos31q36+S8WFcjuE9iTVVK99CpTDQuXbk7qmz8taAGRlAJq9t50o2qllIAACKJitHu+cCF4ApBdS5d/XdB+fqnguLq6upobm4Kx/GyQ3m9Xk+9+uqrk21tbZquri6t1+vFWZYFi8WSdDgcsV27di1qtdqCYb3ZbCZra2sjueaW/yl0XV1dNBwOZ/mT/KIxB6VSSTkcjlhuey44X8lkMqVy5TmC6/V6qrGx0Z8bPY6OjsrWrFkT1el0ec9CUZRVqVSUWq2mqqur4xs2bAgL+XQSiYTJvZcf9Njt9uRdd90Vys2PcQnd5ubmAMMwcPPmTXk0GhUDpCsRVVVVsccee2yBS0PxIZLqacszfZPBP7+qj4+1Kilf+lNuYtkDEU3La3mfcmsfPL4gqfxFrJxPuYll22Kmp/omgpf+zZia7ZEyCT+KGVcn5WsP+uUNh0IAAP8PaQRnE4MgdzkAAAAASUVORK5CYII=);";
546+
ret<<" width: 154px; height: 20px; }"<<endl;
547+
ret<<"a#appname { margin: 0; font-size: 27px; color: #666; text-decoration: none; font-weight: bold; display: block; }"<<endl;
548+
ret<<"footer { border-top: 1px solid #ddd; padding-top: 4px; font-size: 12px; }"<<endl;
549+
ret<<"footer.row { margin-top: 1em; margin-bottom: 1em; }"<<endl;
550+
ret<<".panel { background: #f2f2f2; border: 1px solid #e6e6e6; margin: 0 0 22px 0; padding: 20px; }"<<endl;
551+
ret<<"table.data { width: 100%; border-spacing: 0; border-top: 1px solid #333; }"<<endl;
552+
ret<<"table.data td { border-bottom: 1px solid #333; padding: 2px; }"<<endl;
553+
ret<<"table.data tr:nth-child(2n) { background: #e2e2e2; }"<<endl;
554+
ret<<"table.data tr:hover { background: white; }"<<endl;
555+
ret<<".ringmeta { margin-bottom: 5px; }"<<endl;
556+
ret<<".resetring {float: right; }"<<endl;
557+
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;
558+
ret<<".resetring:hover i { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAA2ElEQVQY013PMUoDcRDF4c+kEzxCsNNCrBQvIGhnlcYm11EkBxAraw8gglgIoiJpAoKIYlBcgrgopsma3c3fwt1k9cHA480M8xvQp/nMjorOWY5ov7IAYlpjQk7aYxcuWBpwFQgJnUcaYk7GhEDIGL5w+MVpKLIRyR2b4JOjvGhUKzHTv2W7iuSN479Dvu9plf1awbQ6y3x1sU5tjpVJcMbakF6Ycoas8Dl5xEHJ160wRdfqzXfa6XQ4PLDlicWUjxHxZfndL/N+RhiwNzl/Q6PDhn/qsl76H7prcApk2B1aAAAAAElFTkSuQmCC);}"<<endl;
559+
ret<<".resizering {float: right;}"<<endl;
560+
return ret.str();
561+
}
562+
521563
void StatWebServer::launch()
522564
{
523565
try {
524566
d_ws->setCaller(this);
525567
d_ws->registerHandler("",&indexfunction);
568+
d_ws->registerHandler("style.css",&cssfunction);
526569
if(::arg().mustDo("experimental-json-interface"))
527570
d_ws->registerHandler("jsonstat", &jsonstat);
528571
d_ws->go();

pdns/ws.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ private:
8787
static void *threadHelper(void *);
8888
static void *statThreadHelper(void *p);
8989
static string indexfunction(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom);
90+
static string cssfunction(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom);
9091
static string jsonstat(const string& method, const string& post, const map<string,string> &varmap, void *ptr, bool *custom);
9192
void printvars(ostringstream &ret);
9293
void printargs(ostringstream &ret);

0 commit comments

Comments
 (0)