From: Alexander Moisseev Date: Fri, 10 Feb 2017 09:39:33 +0000 (+0300) Subject: [WebUI] Add basic cluster support to Throughput tab X-Git-Tag: 1.5.0~139^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1408%2Fhead;p=rspamd.git [WebUI] Add basic cluster support to Throughput tab --- diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index 3ff73956d..4ab3e2c13 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -150,7 +150,7 @@ function($, D3Evolution, unused) { var interface = {}; - interface.draw = function(rspamd, graphs, checked_server, type) { + interface.draw = function(rspamd, graphs, neighbours, checked_server, type) { if (graphs.graph === undefined) { graphs.graph = initGraph(); } @@ -163,10 +163,18 @@ function($, D3Evolution, unused) { type = getSelector("selData"); } + if (checked_server === "All SERVERS") { + rspamd.alertMessage('alert-error', 'Data consolidation is not implemented yet'); + graphs.graph.data(); + graphs.rrd_pie.destroy(); + drawRrdTable([]); + return; + } + $.ajax({ dataType: 'json', type: 'GET', - url: 'graph', + url: neighbours[checked_server].url + 'graph', jsonp: false, data: { "type": type diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 98e6f5429..576eda13b 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -93,14 +93,14 @@ define(['jquery', 'd3pie', 'visibility', 'app/stats', 'app/graph', 'app/config', }); break; case "#throughput_nav": - tab_graph.draw(interface, graphs, checked_server, selData); + tab_graph.draw(interface, graphs, neighbours, checked_server, selData); var autoRefresh = { hourly: 60000, daily: 300000 }; timer_id.throughput = Visibility.every(autoRefresh[selData] || 3600000, function () { - tab_graph.draw(interface, graphs, checked_server, selData); + tab_graph.draw(interface, graphs, neighbours, checked_server, selData); }); break; case "#configuration_nav":