mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: stats: get rid of the STAT_SHOWADMIN flag
This flag is used to decide to show the check box in front of a proxy on the HTML stat page. It is always equal to STAT_ADMIN except when the proxy has no backend capability (i.e. a pure frontend) or has no server, in which case it's only used to avoid leaving an empty column at the beginning of the table. Not only this is pretty useless, but it also causes the columns not to align well when mixing multiple proxies with or without servers. Let's simply always use STAT_ADMIN and get rid of this flag.
This commit is contained in:
parent
578d6e4360
commit
ab02b3f345
@ -34,7 +34,6 @@
|
||||
#define STAT_SHNODE 0x00000200 /* conf: show node name */
|
||||
#define STAT_SHDESC 0x00000400 /* conf: show description */
|
||||
#define STAT_SHLGNDS 0x00000800 /* conf: show legends */
|
||||
#define STAT_SHOWADMIN 0x00001000 /* conf: show the admin column */
|
||||
|
||||
#define STAT_BOUND 0x00800000 /* bound statistics to selected proxies/types/services */
|
||||
#define STAT_STARTED 0x01000000 /* some output has occurred */
|
||||
|
14
src/stats.c
14
src/stats.c
@ -670,7 +670,7 @@ err:
|
||||
}
|
||||
|
||||
/* Dump all fields from <stats> into <out> using the HTML format. A column is
|
||||
* reserved for the checkbox is STAT_SHOWADMIN is set in <flags>. Some extra info
|
||||
* reserved for the checkbox is STAT_ADMIN is set in <flags>. Some extra info
|
||||
* are provided if STAT_SHLGNDS is present in <flags>.
|
||||
*/
|
||||
static int stats_dump_fields_html(struct buffer *out,
|
||||
@ -684,7 +684,7 @@ static int stats_dump_fields_html(struct buffer *out,
|
||||
/* name, queue */
|
||||
"<tr class=\"frontend\">");
|
||||
|
||||
if (flags & STAT_SHOWADMIN) {
|
||||
if (flags & STAT_ADMIN) {
|
||||
/* Column sub-heading for Enable or Disable server */
|
||||
chunk_appendf(out, "<td></td>");
|
||||
}
|
||||
@ -827,7 +827,7 @@ static int stats_dump_fields_html(struct buffer *out,
|
||||
}
|
||||
else if (stats[ST_F_TYPE].u.u32 == STATS_TYPE_SO) {
|
||||
chunk_appendf(out, "<tr class=socket>");
|
||||
if (flags & STAT_SHOWADMIN) {
|
||||
if (flags & STAT_ADMIN) {
|
||||
/* Column sub-heading for Enable or Disable server */
|
||||
chunk_appendf(out, "<td></td>");
|
||||
}
|
||||
@ -932,7 +932,7 @@ static int stats_dump_fields_html(struct buffer *out,
|
||||
(stats[ST_F_BCK].u.u32) ? "backup" : "active", style);
|
||||
|
||||
|
||||
if (flags & STAT_SHOWADMIN)
|
||||
if (flags & STAT_ADMIN)
|
||||
chunk_appendf(out,
|
||||
"<td><input class='%s-checkbox' type=\"checkbox\" name=\"s\" value=\"%s\"></td>",
|
||||
field_str(stats, ST_F_PXNAME),
|
||||
@ -1188,7 +1188,7 @@ static int stats_dump_fields_html(struct buffer *out,
|
||||
}
|
||||
else if (stats[ST_F_TYPE].u.u32 == STATS_TYPE_BE) {
|
||||
chunk_appendf(out, "<tr class=\"backend\">");
|
||||
if (flags & STAT_SHOWADMIN) {
|
||||
if (flags & STAT_ADMIN) {
|
||||
/* Column sub-heading for Enable or Disable server */
|
||||
chunk_appendf(out, "<td></td>");
|
||||
}
|
||||
@ -1356,9 +1356,7 @@ int stats_dump_one_line(const struct field *stats, unsigned int flags, struct pr
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((px->cap & PR_CAP_BE) && px->srv && (appctx->ctx.stats.flags & STAT_ADMIN))
|
||||
flags |= STAT_SHOWADMIN;
|
||||
|
||||
flags |= appctx->ctx.stats.flags & STAT_ADMIN;
|
||||
if (appctx->ctx.stats.flags & STAT_FMT_HTML)
|
||||
ret = stats_dump_fields_html(&trash, stats, flags);
|
||||
else if (appctx->ctx.stats.flags & STAT_FMT_TYPED)
|
||||
|
Loading…
x
Reference in New Issue
Block a user