]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Add basic cluster support to Throughput tab 1408/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 10 Feb 2017 09:39:33 +0000 (12:39 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Fri, 10 Feb 2017 09:39:33 +0000 (12:39 +0300)
interface/js/app/graph.js
interface/js/app/rspamd.js

index 3ff73956d6341a2b513ebbab9a213fa996b5ba0a..4ab3e2c13fc8cf3a5e8973182cfd489797f158ea 100644 (file)
@@ -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
index 98e6f54298553249907ac8d1e0cabd97a7109e06..576eda13bf0079bbc09ec43bacb0dd6c148e0ace 100644 (file)
@@ -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":