From: Vsevolod Stakhov Date: Wed, 23 Sep 2015 12:35:42 +0000 (+0100) Subject: Improve pie colors. X-Git-Tag: 1.0.2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=935367f511cf6f10342bf411b13f6cd2ee94ef00;p=rspamd.git Improve pie colors. --- 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));