summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-23 13:35:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-23 13:35:42 +0100
commit935367f511cf6f10342bf411b13f6cd2ee94ef00 (patch)
tree796f8ac440047103756772251a8629de2b3ef481
parentdc9008931b1850b732dcbcc2e03e4dec2c3340ec (diff)
downloadrspamd-935367f511cf6f10342bf411b13f6cd2ee94ef00.tar.gz
rspamd-935367f511cf6f10342bf411b13f6cd2ee94ef00.zip
Improve pie colors.
-rw-r--r--src/controller.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/controller.c b/src/controller.c
index 69132de70..3d589be26 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -874,7 +874,7 @@ rspamd_controller_pie_element (enum rspamd_metric_action action,
[METRIC_ACTION_REJECT] = "#993300",
[METRIC_ACTION_SOFT_REJECT] = "#cc9966",
[METRIC_ACTION_REWRITE_SUBJECT] = "#ff6600",
- [METRIC_ACTION_ADD_HEADER] = "#ffcc66",
+ [METRIC_ACTION_ADD_HEADER] = "#CD853F",
[METRIC_ACTION_GREYLIST] = "#6666cc",
[METRIC_ACTION_NOACTION] = "#66cc00"
};
@@ -883,6 +883,7 @@ rspamd_controller_pie_element (enum rspamd_metric_action action,
"color", 0, false);
ucl_object_insert_key (res, ucl_object_fromstring (label), "label", 0, false);
ucl_object_insert_key (res, ucl_object_fromdouble (data), "data", 0, false);
+ ucl_object_insert_key (res, ucl_object_fromdouble (data), "value", 0, false);
return res;
}
@@ -922,12 +923,9 @@ rspamd_controller_handle_pie_chart (
data[1] = ctx->srv->stat->actions_stat[METRIC_ACTION_SOFT_REJECT] / total *
100.;
data[2] = (ctx->srv->stat->actions_stat[METRIC_ACTION_ADD_HEADER] +
- ctx->srv->stat->actions_stat[METRIC_ACTION_REWRITE_SUBJECT]) /
- total * 100.;
- data[3] = ctx->srv->stat->actions_stat[METRIC_ACTION_GREYLIST] / total *
- 100.;
- data[4] = ctx->srv->stat->actions_stat[METRIC_ACTION_REJECT] / total *
- 100.;
+ ctx->srv->stat->actions_stat[METRIC_ACTION_REWRITE_SUBJECT]);
+ data[3] = ctx->srv->stat->actions_stat[METRIC_ACTION_GREYLIST];
+ data[4] = ctx->srv->stat->actions_stat[METRIC_ACTION_REJECT];
}
else {
memset (data, 0, sizeof (data));