MINOR: stats: do not display empty stat module title on html
If a stat module is not available on the current proxy scope, do not
display its title on the related html box. This is clearer for the user.
diff --git a/src/stats.c b/src/stats.c
index 82e2b1f..762672f 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -949,22 +949,24 @@
if (flags & STAT_SHMODULES) {
list_for_each_entry(mod, &stats_module_list[STATS_DOMAIN_PROXY], list) {
- chunk_appendf(out,
- "<td><u>%s<div class=tips><table class=det>",
- mod->name);
+ chunk_appendf(out, "<td>");
+
if (stats_px_get_cap(mod->domain_flags) & STATS_PX_CAP_FE) {
+ chunk_appendf(out,
+ "<u>%s<div class=tips><table class=det>",
+ mod->name);
for (j = 0; j < mod->stats_count; ++j) {
chunk_appendf(out,
"<tr><th>%s</th><td>%s</td></tr>",
mod->stats[j].desc, field_to_html_str(&stats[ST_F_TOTAL_FIELDS + i]));
++i;
}
+ chunk_appendf(out, "</table></div></u>");
} else {
i += mod->stats_count;
}
- chunk_appendf(out,
- "</table></div></u></td>");
+ chunk_appendf(out, "</td>");
}
}
@@ -1033,22 +1035,24 @@
if (flags & STAT_SHMODULES) {
list_for_each_entry(mod, &stats_module_list[STATS_DOMAIN_PROXY], list) {
- chunk_appendf(out,
- "<td><u>%s<div class=tips><table class=det>",
- mod->name);
+ chunk_appendf(out, "<td>");
+
if (stats_px_get_cap(mod->domain_flags) & STATS_PX_CAP_LI) {
+ chunk_appendf(out,
+ "<u>%s<div class=tips><table class=det>",
+ mod->name);
for (j = 0; j < mod->stats_count; ++j) {
chunk_appendf(out,
"<tr><th>%s</th><td>%s</td></tr>",
mod->stats[j].desc, field_to_html_str(&stats[ST_F_TOTAL_FIELDS + i]));
++i;
}
+ chunk_appendf(out, "</table></div></u>");
} else {
i += mod->stats_count;
}
- chunk_appendf(out,
- "</table></div></u></td>");
+ chunk_appendf(out, "</td>");
}
}
@@ -1371,22 +1375,24 @@
if (flags & STAT_SHMODULES) {
list_for_each_entry(mod, &stats_module_list[STATS_DOMAIN_PROXY], list) {
- chunk_appendf(out,
- "<td><u>%s<div class=tips><table class=det>",
- mod->name);
+ chunk_appendf(out, "<td>");
+
if (stats_px_get_cap(mod->domain_flags) & STATS_PX_CAP_SRV) {
+ chunk_appendf(out,
+ "<u>%s<div class=tips><table class=det>",
+ mod->name);
for (j = 0; j < mod->stats_count; ++j) {
chunk_appendf(out,
"<tr><th>%s</th><td>%s</td></tr>",
mod->stats[j].desc, field_to_html_str(&stats[ST_F_TOTAL_FIELDS + i]));
++i;
}
+ chunk_appendf(out, "</table></div></u>");
} else {
i += mod->stats_count;
}
- chunk_appendf(out,
- "</table></div></u></td>");
+ chunk_appendf(out, "</td>");
}
}
@@ -1562,21 +1568,24 @@
if (flags & STAT_SHMODULES) {
list_for_each_entry(mod, &stats_module_list[STATS_DOMAIN_PROXY], list) {
- chunk_appendf(out,
- "<td><u>%s<div class=tips><table class=det>",
- mod->name);
+ chunk_appendf(out, "<td>");
+
if (stats_px_get_cap(mod->domain_flags) & STATS_PX_CAP_BE) {
+ chunk_appendf(out,
+ "<u>%s<div class=tips><table class=det>",
+ mod->name);
for (j = 0; j < mod->stats_count; ++j) {
chunk_appendf(out,
"<tr><th>%s</th><td>%s</td></tr>",
mod->stats[j].desc, field_to_html_str(&stats[ST_F_TOTAL_FIELDS + i]));
++i;
}
+ chunk_appendf(out, "</table></div></u>");
} else {
i += mod->stats_count;
}
- chunk_appendf(out,
- "</table></div></u></td>");
+
+ chunk_appendf(out, "</td>");
}
}