diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2017-02-13 13:33:45 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2017-02-13 13:33:45 +0300 |
commit | 4b7282fef3624e7e01dd71d81c88e494fbc02226 (patch) | |
tree | 38dc6b8be98c4a9178cbaee30f55c4619f88dbfa /interface | |
parent | 3125cf20b87ff211cf2326b9682b39703a996066 (diff) | |
download | rspamd-4b7282fef3624e7e01dd71d81c88e494fbc02226.tar.gz rspamd-4b7282fef3624e7e01dd71d81c88e494fbc02226.zip |
[WebUI] Fix `All SERVERS` graph fot just one available server
Diffstat (limited to 'interface')
-rw-r--r-- | interface/js/app/graph.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index 9f8043958..3b2c2be35 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -179,11 +179,13 @@ function($, D3Evolution, unused) { } if (checked_server === "All SERVERS") { - rspamd.queryNeighbours("graph", function (neighbours_data) { - neighbours_data + rspamd.queryNeighbours("graph", function (req_data) { + let neighbours_data = req_data .filter(function (d) { return d.status }) // filter out unavailable neighbours .map(function (d){ return d.data; }) - .reduce(function (res, curr) { + + if (neighbours_data.length > 1) { + neighbours_data.reduce(function (res, curr) { if ((curr[0][0].x !== res[0][0].x) || (curr[0][curr[0].length - 1].x !== res[0][res[0].length - 1].x)) { rspamd.alertMessage('alert-error', @@ -205,6 +207,10 @@ function($, D3Evolution, unused) { }); updateWidgets(data); }); + } + else { + updateWidgets(neighbours_data[0]); + } }, function (serv, jqXHR, textStatus, errorThrown) { var alert_status = serv.name + '_alerted'; |