ASF Bugzilla – Attachment 21765 Details for
Bug 26835
[PATCH] Mod_status Readability & Browser Side Table Sorting enhancements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch adding ExtendedStatusCssUrl and ExtendedStatusJsUrl
mod_status.c.diff (text/plain), 11.74 KB, created by
Olivier Grange-Labat
on 2008-04-02 04:26:24 UTC
(
hide
)
Description:
patch adding ExtendedStatusCssUrl and ExtendedStatusJsUrl
Filename:
MIME Type:
Creator:
Olivier Grange-Labat
Created:
2008-04-02 04:26:24 UTC
Size:
11.74 KB
patch
obsolete
>Index: mod_status.c >=================================================================== >--- mod_status.c (revision 643801) >+++ mod_status.c (working copy) >@@ -99,6 +99,9 @@ > > module AP_MODULE_DECLARE_DATA status_module; > >+static char *ap_extended_status_css_url; >+static char *ap_extended_status_js_url; >+ > static int server_limit, thread_limit; > > /* Implement 'ap_run_status_hook'. */ >@@ -139,11 +142,34 @@ > return NULL; > } > >+static const char *set_extended_status_css_url(cmd_parms *cmd, void *dummy, const char *arg) >+{ >+ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); >+ if (err != NULL) { >+ return err; >+ } >+ ap_extended_status_css_url = (char *) arg; >+ return NULL; >+} > >+static const char *set_extended_status_js_url(cmd_parms *cmd, void *dummy, const char *arg) >+{ >+ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); >+ if (err != NULL) { >+ return err; >+ } >+ ap_extended_status_js_url = (char *) arg; >+ return NULL; >+} >+ > static const command_rec status_module_cmds[] = > { > AP_INIT_FLAG("ExtendedStatus", set_extended_status, NULL, RSRC_CONF, > "\"On\" to enable extended status information, \"Off\" to disable"), >+ AP_INIT_TAKE1("ExtendedStatusCssUrl", set_extended_status_css_url, NULL, >+ RSRC_CONF, "URL of CSS stylesheet to include in extended status page"), >+ AP_INIT_TAKE1("ExtendedStatusJsUrl", set_extended_status_js_url, NULL, >+ RSRC_CONF, "URL of JS to include in extended status page"), > AP_INIT_FLAG("SeeRequestTail", set_reqtail, NULL, RSRC_CONF, > "For verbose requests, \"On\" to see the last 63 chars of the request, " > "\"Off\" (default) to see the first 63 in extended status display"), >@@ -405,28 +431,40 @@ > ap_scoreboard_image->global->restart_time); > > if (!short_report) { >- ap_rputs(DOCTYPE_HTML_3_2 >- "<html><head>\n<title>Apache Status</title>\n</head><body>\n", >- r); >+ ap_rvputs(r, DOCTYPE_HTML_4_0T >+ "<html><head>\n<title>Apache Status for ", >+ ap_get_server_name(r), "</title>\n", NULL); >+ if (ap_extended_status_css_url) { >+ ap_rvputs(r, "<link rel=\"stylesheet\" href=\"", >+ ap_extended_status_css_url, >+ "\" type=\"text/css\">\n", NULL); >+ } >+ if (ap_extended_status_js_url) { >+ ap_rvputs(r, "<script type=\"text/javascript\" src=\"", >+ ap_extended_status_js_url, >+ "\"></script>\n", NULL); >+ } >+ ap_rputs("</head><body>\n", r); >+ > ap_rputs("<h1>Apache Server Status for ", r); > ap_rvputs(r, ap_get_server_name(r), "</h1>\n\n", NULL); >- ap_rvputs(r, "<dl><dt>Server Version: ", >- ap_get_server_description(), "</dt>\n", NULL); >- ap_rvputs(r, "<dt>Server Built: ", >- ap_get_server_built(), "\n</dt></dl><hr /><dl>\n", NULL); >- ap_rvputs(r, "<dt>Current Time: ", >+ ap_rvputs(r, "<dl><dt>Server Version:</dt><dd>", >+ ap_get_server_description(), "</dd>\n", NULL); >+ ap_rvputs(r, "<dt>Server Built:</dt><dd>", >+ ap_get_server_built(), "\n</dd></dl><hr><dl>\n", NULL); >+ ap_rvputs(r, "<dt>Current Time:</dt><dd>", > ap_ht_time(r->pool, nowtime, DEFAULT_TIME_FORMAT, 0), >- "</dt>\n", NULL); >- ap_rvputs(r, "<dt>Restart Time: ", >+ "</dd>\n", NULL); >+ ap_rvputs(r, "<dt>Restart Time:</dt><dd>", > ap_ht_time(r->pool, > ap_scoreboard_image->global->restart_time, > DEFAULT_TIME_FORMAT, 0), >- "</dt>\n", NULL); >- ap_rprintf(r, "<dt>Parent Server Generation: %d</dt>\n", >+ "</dd>\n", NULL); >+ ap_rprintf(r, "<dt>Parent Server Generation:</dt><dd>%d</dd>\n", > (int)ap_my_generation); >- ap_rputs("<dt>Server uptime: ", r); >+ ap_rputs("<dt>Server uptime:</dt><dd>", r); > show_time(r, up_time); >- ap_rputs("</dt>\n", r); >+ ap_rputs("</dd>\n", r); > } > > if (ap_extended_status) { >@@ -456,22 +494,22 @@ > KBYTE * (float) kbcount / (float) count); > } > else { /* !short_report */ >- ap_rprintf(r, "<dt>Total accesses: %lu - Total Traffic: ", count); >+ ap_rprintf(r, "<dt>Total accesses:</dt><dd>%lu</dd><dt>Total Traffic:</dt><dd>", count); > format_kbyte_out(r, kbcount); >- ap_rputs("</dt>\n", r); >+ ap_rputs("</dd>\n", r); > > #ifdef HAVE_TIMES > /* Allow for OS/2 not having CPU stats */ >- ap_rprintf(r, "<dt>CPU Usage: u%g s%g cu%g cs%g", >+ ap_rprintf(r, "<dt>CPU Usage:</dt><dd>u%g s%g cu%g cs%g", > tu / tick, ts / tick, tcu / tick, tcs / tick); > > if (ts || tu || tcu || tcs) >- ap_rprintf(r, " - %.3g%% CPU load</dt>\n", >+ ap_rprintf(r, " - %.3g%% CPU load</dd>\n", > (tu + ts + tcu + tcs) / tick / up_time * 100.); > #endif > > if (up_time > 0) >- ap_rprintf(r, "<dt>%.3g requests/sec - ", >+ ap_rprintf(r, "<dt>Mean since last restart:</dt><dd>%.3g requests/sec - ", > (float) count / (float) up_time); > > if (up_time > 0) { >@@ -486,13 +524,13 @@ > ap_rputs("/request", r); > } > >- ap_rputs("</dt>\n", r); >+ ap_rputs("</dd>\n", r); > } /* short_report */ > } /* ap_extended_status */ > > if (!short_report) >- ap_rprintf(r, "<dt>%d requests currently being processed, " >- "%d idle workers</dt>\n", busy, ready); >+ ap_rprintf(r, "<dt>Current:</dt><dd>%d request(s) being processed, " >+ "%d idle workers</dd>\n", busy, ready); > else > ap_rprintf(r, "BusyWorkers: %d\nIdleWorkers: %d\n", busy, ready); > >@@ -516,23 +554,23 @@ > ap_rputs("\n", r); > else { > ap_rputs("</pre>\n", r); >- ap_rputs("<p>Scoreboard Key:<br />\n", r); >+ ap_rputs("<p>Scoreboard Key:<br>\n", r); > ap_rputs("\"<b><code>_</code></b>\" Waiting for Connection, \n", r); > ap_rputs("\"<b><code>S</code></b>\" Starting up, \n", r); >- ap_rputs("\"<b><code>R</code></b>\" Reading Request,<br />\n", r); >+ ap_rputs("\"<b><code>R</code></b>\" Reading Request,<br>\n", r); > ap_rputs("\"<b><code>W</code></b>\" Sending Reply, \n", r); > ap_rputs("\"<b><code>K</code></b>\" Keepalive (read), \n", r); >- ap_rputs("\"<b><code>D</code></b>\" DNS Lookup,<br />\n", r); >+ ap_rputs("\"<b><code>D</code></b>\" DNS Lookup,<br>\n", r); > ap_rputs("\"<b><code>C</code></b>\" Closing connection, \n", r); > ap_rputs("\"<b><code>L</code></b>\" Logging, \n", r); >- ap_rputs("\"<b><code>G</code></b>\" Gracefully finishing,<br /> \n", r); >+ ap_rputs("\"<b><code>G</code></b>\" Gracefully finishing,<br> \n", r); > ap_rputs("\"<b><code>I</code></b>\" Idle cleanup of worker, \n", r); > ap_rputs("\"<b><code>.</code></b>\" Open slot with no current process</p>\n", r); >- ap_rputs("<p />\n", r); >+ ap_rputs("\n", r); > if (!ap_extended_status) { > int j; > int k = 0; >- ap_rputs("PID Key: <br />\n", r); >+ ap_rputs("PID Key: <br>\n", r); > ap_rputs("<pre>\n", r); > for (i = 0; i < server_limit; ++i) { > for (j = 0; j < thread_limit; ++j) { >@@ -559,9 +597,9 @@ > > if (ap_extended_status && !short_report) { > if (no_table_report) >- ap_rputs("<hr /><h2>Server Details</h2>\n\n", r); >+ ap_rputs("<hr><h2>Server Details</h2>\n\n", r); > else >- ap_rputs("\n\n<table border=\"0\"><tr>" >+ ap_rputs("\n\n<table><tr>" > "<th>Srv</th><th>PID</th><th>Acc</th>" > "<th>M</th>" > #ifdef HAVE_TIMES >@@ -683,7 +721,7 @@ > format_byte_out(r, bytes); > ap_rputs(")\n", r); > ap_rprintf(r, >- " <i>%s {%s}</i> <b>[%s]</b><br />\n\n", >+ " <i>%s {%s}</i> <b>[%s]</b><br>\n\n", > ap_escape_html(r->pool, > ws_record->client), > ap_escape_html(r->pool, >@@ -695,14 +733,15 @@ > else { /* !no_table_report */ > if (ws_record->status == SERVER_DEAD) > ap_rprintf(r, >- "<tr><td><b>%d-%d</b></td><td>-</td><td>%d/%lu/%lu", >+ "<tr class=\"server_dead\"><td><b>%d-%d</b></td><td>-</td><td>%d/%lu/%lu", > i, (int)worker_generation, > (int)conn_lres, my_lres, lres); > else > ap_rprintf(r, >- "<tr><td><b>%d-%d</b></td><td>%" >+ "<tr class=\"server_%c\"><td><b>%d-%d</b></td><td>%" > APR_PID_T_FMT > "</td><td>%d/%lu/%lu", >+ status_flags[ws_record->status], > i, (int)worker_generation, > worker_pid, > (int)conn_lres, >@@ -713,25 +752,25 @@ > ap_rputs("</td><td>_", r); > break; > case SERVER_STARTING: >- ap_rputs("</td><td><b>S</b>", r); >+ ap_rputs("</td><td>S", r); > break; > case SERVER_BUSY_READ: >- ap_rputs("</td><td><b>R</b>", r); >+ ap_rputs("</td><td>R", r); > break; > case SERVER_BUSY_WRITE: >- ap_rputs("</td><td><b>W</b>", r); >+ ap_rputs("</td><td>W", r); > break; > case SERVER_BUSY_KEEPALIVE: >- ap_rputs("</td><td><b>K</b>", r); >+ ap_rputs("</td><td>K", r); > break; > case SERVER_BUSY_LOG: >- ap_rputs("</td><td><b>L</b>", r); >+ ap_rputs("</td><td>L", r); > break; > case SERVER_BUSY_DNS: >- ap_rputs("</td><td><b>D</b>", r); >+ ap_rputs("</td><td>D", r); > break; > case SERVER_CLOSING: >- ap_rputs("</td><td><b>C</b>", r); >+ ap_rputs("</td><td>C", r); > break; > case SERVER_DEAD: > ap_rputs("</td><td>.", r); >@@ -786,7 +825,7 @@ > > if (!no_table_report) { > ap_rputs("</table>\n \ >-<hr /> \ >+<hr> \ > <table>\n \ > <tr><th>Srv</th><td>Child Server number - generation</td></tr>\n \ > <tr><th>PID</th><td>OS process ID</td></tr>\n \ >@@ -808,7 +847,7 @@ > else { > > if (!short_report) { >- ap_rputs("<hr />To obtain a full report with current status " >+ ap_rputs("<hr>To obtain a full report with current status " > "information you need to use the " > "<code>ExtendedStatus On</code> directive.\n", r); > } >@@ -825,7 +864,7 @@ > } > > if (!short_report) { >- ap_rputs(ap_psignature("<hr />\n",r), r); >+ ap_rputs(ap_psignature("<hr>\n",r), r); > ap_rputs("</body></html>\n", r); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 26835
:
21752
| 21765 |
21766