From ba6be983d617a11776570d089b7a07f0a93d1b5f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 19 Apr 2013 12:16:55 +0200 Subject: [PATCH] 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. --- src/dumpstats.c | 49 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index 806d9c6d8..168b0ade3 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"); }