diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2019-03-29 12:41:49 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2019-03-29 12:41:49 +0300 |
commit | ea8b71e211d18070397e6cb9b6bbde20366fce56 (patch) | |
tree | 35d04ca3d123493a113e8dcfe9fdfafc1e9894f6 /interface | |
parent | ee9ef02177c8f551bee1fec1493a76135873aa8b (diff) | |
download | rspamd-ea8b71e211d18070397e6cb9b6bbde20366fce56.tar.gz rspamd-ea8b71e211d18070397e6cb9b6bbde20366fce56.zip |
[WebUI] Show grayed out pie
when throughput percentage is undefined
Diffstat (limited to 'interface')
-rw-r--r-- | interface/js/app/graph.js | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index e01d97aff..2fd66b555 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -204,12 +204,40 @@ define(["jquery", "d3evolution", "footable"], } rrd_summary = getRrdSummary(data, scaleFactor); + } + + if (graphs.rrd_pie) { + graphs.rrd_pie.destroy(); + delete graphs.rrd_pie; + } + if (rrd_summary.total) { graphs.rrd_pie = rspamd.drawPie(graphs.rrd_pie, "rrd-pie", rrd_summary.rows, rrd_pie_config); - } else if (graphs.rrd_pie) { - graphs.rrd_pie.destroy(); + } else { + // Show grayed out pie as percentage is undefined + graphs.rrd_pie = rspamd.drawPie(graphs.rrd_pie, + "rrd-pie", + [{ + value: 1, + color: "#FFFFFF", + }], + $.extend({}, rrd_pie_config, { + labels: { + outer: { + format: "none" + }, + inner: { + format: "none" + }, + }, + tooltips: { + enabled: true, + string: "Undefined" + }, + }) + ); } graphs.graph.data(data); |