diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-08 10:01:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-08 10:01:42 +0100 |
commit | 50e4a10338fea60efc20762949546c89a01bdd55 (patch) | |
tree | 2a50585531922e00fdd2071a465570885c0b637d | |
parent | 67a8409192e8d97f30cb4aeba7860aa2562d1583 (diff) | |
parent | 9e7ace03e89404b3c492b9e62a5078df76b1e56f (diff) | |
download | rspamd-50e4a10338fea60efc20762949546c89a01bdd55.tar.gz rspamd-50e4a10338fea60efc20762949546c89a01bdd55.zip |
Merge pull request #1583 from moisseev/webui
[WebUI] Check if neighbours' history backend versions match
-rw-r--r-- | interface/js/app/history.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 779ed6855..8c3db7b9d 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -417,10 +417,21 @@ function($, _, Humanize) { if (checked_server === "All SERVERS") { rspamd.queryNeighbours("history", function (req_data) { + function differentVersions() { + const dv = neighbours_data.some(function (e) { + return e.version !== neighbours_data[0].version; + }); + if (dv) { + rspamd.alertMessage('alert-error', + 'Neighbours history backend versions do not match. Cannot display history.'); + return true; + } + } + var neighbours_data = req_data .filter(function (d) { return d.status }) // filter out unavailable neighbours .map(function (d){ return d.data; }); - if (neighbours_data.length > 0) { + if (neighbours_data.length && !differentVersions()) { var data = {}; if (neighbours_data[0].version) { data.rows = [].concat.apply([], neighbours_data @@ -455,8 +466,12 @@ function($, _, Humanize) { filtering: FooTable.actionFilter } }); + } else { + if (ft.history) { + ft.history.destroy(); + ft.history = undefined; + } } - }); } else { |