BUG/MINOR: stats: Fix HTML output for the frontends heading

Since the flag STAT_SHOWADMIN was removed, the frontends heading in the HTML
output appears unaligned because the space reserved for the checkbox (not
displayed for frontends) is not inserted.

This patch fixes the issue #390. It must be backported to 2.1.
This commit is contained in:
Christopher Faulet 2019-12-02 11:29:04 +01:00
parent bc96c90614
commit bc271ec113

View File

@ -2020,14 +2020,17 @@ static void stats_dump_html_px_hdr(struct stream_interface *si, struct proxy *px
(appctx->ctx.stats.flags & STAT_SHLGNDS) ? "</u>":"", (appctx->ctx.stats.flags & STAT_SHLGNDS) ? "</u>":"",
px->desc ? "desc" : "empty", px->desc ? px->desc : ""); px->desc ? "desc" : "empty", px->desc ? px->desc : "");
if ((px->cap & PR_CAP_BE) && px->srv && (appctx->ctx.stats.flags & STAT_ADMIN)) { if (appctx->ctx.stats.flags & STAT_ADMIN) {
/* Column heading for Enable or Disable server */ /* Column heading for Enable or Disable server */
chunk_appendf(&trash, if ((px->cap & PR_CAP_BE) && px->srv)
"<th rowspan=2 width=1><input type=\"checkbox\" \ chunk_appendf(&trash,
onclick=\"for(c in document.getElementsByClassName('%s-checkbox')) \ "<th rowspan=2 width=1><input type=\"checkbox\" "
document.getElementsByClassName('%s-checkbox').item(c).checked = this.checked\"></th>", "onclick=\"for(c in document.getElementsByClassName('%s-checkbox')) "
px->id, "document.getElementsByClassName('%s-checkbox').item(c).checked = this.checked\"></th>",
px->id); px->id,
px->id);
else
chunk_appendf(&trash, "<th rowspan=2></th>");
} }
chunk_appendf(&trash, chunk_appendf(&trash,