From: Willy Tarreau Date: Fri, 19 Apr 2013 10:16:55 +0000 (+0200) Subject: BUG/MINOR: stats: fix confirmation links on the stats interface X-Git-Tag: v1.5-dev19~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba6be983d617a11776570d089b7a07f0a93d1b5f;p=thirdparty%2Fhaproxy.git BUG/MINOR: stats: fix confirmation links on the stats interface The confirmation link on the web interface forgets to set the displaying options, so that when one clicks on "[X] Action processed successfully", the auto-refresh, up/down and scope search settings are lost. We need to pass all these info in the new link. --- diff --git a/src/dumpstats.c b/src/dumpstats.c index 806d9c6d80..168b0ade36 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -3252,58 +3252,79 @@ static void stats_dump_html_info(struct stream_interface *si, struct uri_auth *u case STAT_STATUS_DONE: chunk_appendf(&trash, "

" - "[X] " + "[X] " "Action processed successfully." - "
\n", uri->uri_prefix); + "\n", uri->uri_prefix, + (si->applet.ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "", + (si->applet.ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "", + scope_txt); break; case STAT_STATUS_NONE: chunk_appendf(&trash, "

" - "[X] " + "[X] " "Nothing has changed." - "
\n", uri->uri_prefix); + "\n", uri->uri_prefix, + (si->applet.ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "", + (si->applet.ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "", + scope_txt); break; case STAT_STATUS_PART: chunk_appendf(&trash, "

" - "[X] " + "[X] " "Action partially processed.
" "Some server names are probably unknown or ambiguous (duplicated names in the backend)." - "
\n", uri->uri_prefix); + "\n", uri->uri_prefix, + (si->applet.ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "", + (si->applet.ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "", + scope_txt); break; case STAT_STATUS_ERRP: chunk_appendf(&trash, "

" - "[X] " + "[X] " "Action not processed because of invalid parameters." "" - "
\n", uri->uri_prefix); + "\n", uri->uri_prefix, + (si->applet.ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "", + (si->applet.ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "", + scope_txt); break; case STAT_STATUS_EXCD: chunk_appendf(&trash, "

" - "[X] " + "[X] " "Action not processed : the buffer couldn't store all the data.
" "You should retry with less servers at a time.
" - "
\n", uri->uri_prefix); + "\n", uri->uri_prefix, + (si->applet.ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "", + (si->applet.ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "", + scope_txt); break; case STAT_STATUS_DENY: chunk_appendf(&trash, "

" - "[X] " + "[X] " "Action denied." - "
\n", uri->uri_prefix); + "\n", uri->uri_prefix, + (si->applet.ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "", + (si->applet.ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "", + scope_txt); break; default: chunk_appendf(&trash, "

" - "[X] " + "[X] " "Unexpected result." - "
\n", uri->uri_prefix); + "\n", uri->uri_prefix, + (si->applet.ctx.stats.flags & STAT_HIDE_DOWN) ? ";up" : "", + (si->applet.ctx.stats.flags & STAT_NO_REFRESH) ? ";norefresh" : "", + scope_txt); } chunk_appendf(&trash, "

\n"); }