httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1208412 - /httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_balancer.c
Date Wed, 30 Nov 2011 13:15:51 GMT
Author: jim
Date: Wed Nov 30 13:15:51 2011
New Revision: 1208412

URL: http://svn.apache.org/viewvc?rev=1208412&view=rev
Log:
Merge r1208411 from trunk:

use a style sheet... ideally we would pull one off the filesystem,
but for now...
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_balancer.c

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_balancer.c?rev=1208412&r1=1208411&r2=1208412&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_balancer.c Wed Nov 30 13:15:51 2011
@@ -1183,7 +1183,34 @@ static int balancer_handler(request_rec 
     else {
         ap_set_content_type(r, "text/html; charset=ISO-8859-1");
         ap_rputs(DOCTYPE_HTML_3_2
-                 "<html><head><title>Balancer Manager</title></head>\n",
r);
+                 "<html><head><title>Balancer Manager</title>\n",
r);
+        ap_rputs("<style type='text/css'>\n"
+                 "table {\n"
+                 " border-width: 1px;\n"
+                 " border-spacing: 3px;\n"
+                 " border-style: solid;\n"
+                 " border-color: gray;\n"
+                 " border-collapse: collapse;\n"
+                 " background-color: white;\n"
+                 " text-align: center;\n"
+                 "}\n"
+                 "th {\n"
+                 " border-width: 1px;\n"
+                 " padding: 2px;\n"
+                 " border-style: dotted;\n"
+                 " border-color: gray;\n"
+                 " background-color: white;\n"
+                 " text-align: center;\n"
+                 "}\n"
+                 "td {\n"
+                 " border-width: 1px;\n"
+                 " padding: 2px;\n"
+                 " border-style: dotted;\n"
+                 " border-color: gray;\n"
+                 " background-color: white;\n"
+                 " text-align: center;\n"
+                 "}\n"
+                 "</style>\n</head>\n", r);
         ap_rputs("<body><h1>Load Balancer Manager for ", r);
         ap_rvputs(r, ap_get_server_name(r), "</h1>\n\n", NULL);
         ap_rvputs(r, "<dl><dt>Server Version: ",
@@ -1199,44 +1226,44 @@ static int balancer_handler(request_rec 
                       "&nonce=", balancer->s->nonce,
                       "'>", NULL);
             ap_rvputs(r, balancer->s->name, "</a></h3>\n", NULL);
-            ap_rputs("\n\n<table border='0' style='text-align: left;'><tr>"
+            ap_rputs("\n\n<table><tr>"
                 "<th>MaxMembers</th><th>StickySession</th><th>DisableFailover</th><th>Timeout</th><th>FailoverAttempts</th><th>Method</th>"
                 "<th>Path</th><th>Active</th></tr>\n<tr>",
r);
             /* the below is a safe cast, since the number of slots total will
              * never be more than max_workers, which is restricted to int */
-            ap_rprintf(r, "<td align='center'>%d [%d Used]</td>\n", balancer->max_workers,
+            ap_rprintf(r, "<td>%d [%d Used]</td>\n", balancer->max_workers,
                        balancer->max_workers - (int)storage->num_free_slots(balancer->wslot));
             if (*balancer->s->sticky) {
                 if (strcmp(balancer->s->sticky, balancer->s->sticky_path)) {
-                    ap_rvputs(r, "<td align='center'>", balancer->s->sticky,
" | ",
+                    ap_rvputs(r, "<td>", balancer->s->sticky, " | ",
                               balancer->s->sticky_path, NULL);
                 }
                 else {
-                    ap_rvputs(r, "<td align='center'>", balancer->s->sticky,
NULL);
+                    ap_rvputs(r, "<td>", balancer->s->sticky, NULL);
                 }
             }
             else {
-                ap_rputs("<td align='center'> (None) ", r);
+                ap_rputs("<td> (None) ", r);
             }
-            ap_rprintf(r, "<td align='center'>%s</td>\n",
+            ap_rprintf(r, "<td>%s</td>\n",
                        balancer->s->sticky_force ? "On" : "Off");
-            ap_rprintf(r, "</td><td align='center'>%" APR_TIME_T_FMT "</td>",
+            ap_rprintf(r, "</td><td>%" APR_TIME_T_FMT "</td>",
                 apr_time_sec(balancer->s->timeout));
-            ap_rprintf(r, "<td align='center'>%d</td>\n", balancer->s->max_attempts);
-            ap_rprintf(r, "<td align='center'>%s</td>\n",
+            ap_rprintf(r, "<td>%d</td>\n", balancer->s->max_attempts);
+            ap_rprintf(r, "<td>%s</td>\n",
                        balancer->s->lbpname);
-            ap_rputs("<td align='center'>", r);
+            ap_rputs("<td>", r);
             if (balancer->s->vhost && *(balancer->s->vhost)) {
                 ap_rvputs(r, balancer->s->vhost, " -> ", NULL);
             }
             ap_rvputs(r, balancer->s->vpath, "</td>\n", NULL);
-            ap_rprintf(r, "<td align='center'>%s</td>\n",
+            ap_rprintf(r, "<td>%s</td>\n",
                        !balancer->s->inactive ? "Yes" : "No");
             ap_rputs("</table>\n<br />", r);
-            ap_rputs("\n\n<table border='0' style='text-align: left;'><tr>"
+            ap_rputs("\n\n<table><tr>"
                 "<th>Worker URL</th>"
                 "<th>Route</th><th>RouteRedir</th>"
-                "<th>Factor</th><th>Set</th><th align='center'>Status</th>"
+                "<th>Factor</th><th>Set</th><th>Status</th>"
                 "<th>Elected</th><th>Busy</th><th>Load</th><th>To</th><th>From</th>"
                 "</tr>\n", r);
 
@@ -1250,19 +1277,19 @@ static int balancer_handler(request_rec 
                           "&nonce=", balancer->s->nonce,
                           "'>", NULL);
                 ap_rvputs(r, worker->s->name, "</a></td>", NULL);
-                ap_rvputs(r, "<td align='center'>", ap_escape_html(r->pool, worker->s->route),
+                ap_rvputs(r, "<td>", ap_escape_html(r->pool, worker->s->route),
                           NULL);
-                ap_rvputs(r, "</td><td align='center'>",
+                ap_rvputs(r, "</td><td>",
                           ap_escape_html(r->pool, worker->s->redirect), NULL);
-                ap_rprintf(r, "</td><td align='center'>%d</td>", worker->s->lbfactor);
-                ap_rprintf(r, "<td align='center'>%d</td><td align='center'>",
worker->s->lbset);
+                ap_rprintf(r, "</td><td>%d</td>", worker->s->lbfactor);
+                ap_rprintf(r, "<td>%d</td><td>", worker->s->lbset);
                 ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, worker), NULL);
                 ap_rputs("</td>", r);
-                ap_rprintf(r, "<td align='center'>%" APR_SIZE_T_FMT "</td>",
worker->s->elected);
-                ap_rprintf(r, "<td align='center'>%" APR_SIZE_T_FMT "</td>",
worker->s->busy);
-                ap_rprintf(r, "<td align='center'>%d</td><td align='center'>",
worker->s->lbstatus);
+                ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td>", worker->s->elected);
+                ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td>", worker->s->busy);
+                ap_rprintf(r, "<td>%d</td><td>", worker->s->lbstatus);
                 ap_rputs(apr_strfsize(worker->s->transferred, fbuf), r);
-                ap_rputs("</td><td align='center'>", r);
+                ap_rputs("</td><td>", r);
                 ap_rputs(apr_strfsize(worker->s->read, fbuf), r);
                 ap_rputs("</td></tr>\n", r);
 
@@ -1290,7 +1317,7 @@ static int balancer_handler(request_rec 
                       NULL);
             ap_rputs("'></td></tr>\n", r);
             ap_rputs("<tr><td>Status:</td>", r);
-            ap_rputs("<td><table border='1'><tr><th>Ign</th><th>Drn</th><th>Dis</th><th>Stby</th></tr>\n<tr>",
r);
+            ap_rputs("<td><table><tr><th>Ign</th><th>Drn</th><th>Dis</th><th>Stby</th></tr>\n<tr>",
r);
             create_radio("w_status_I", (PROXY_WORKER_IGNORE_ERRORS & wsel->s->status),
r);
             create_radio("w_status_N", (PROXY_WORKER_DRAIN & wsel->s->status),
r);
             create_radio("w_status_D", (PROXY_WORKER_DISABLED & wsel->s->status),
r);



Mime
View raw message