]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Add messages total to throughput summary 2142/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Tue, 3 Apr 2018 14:54:27 +0000 (17:54 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Tue, 3 Apr 2018 14:54:27 +0000 (17:54 +0300)
interface/css/rspamd.css
interface/index.html
interface/js/app/graph.js

index 91f39652b23377910cf9546b51d071e300131d2c..3af8baad737ab293a77808d6856ffca03b3aff9d 100644 (file)
@@ -573,6 +573,7 @@ td.maps-cell {
   width: 100%;
 }
 #rrd-table {
+    margin-bottom: 2px;
     width: 100% !important;
     text-align: left;
     font-size: 12px;
@@ -582,6 +583,12 @@ td.maps-cell {
     padding-top: 2px;
     padding-bottom: 2px;
 }
+#rrd-total {
+    padding-left: 8px;
+    margin-bottom: 10px;
+    text-align: left;
+    font-size: 12px;
+}
 
 /* Throughput graph controls */
 #graph_controls select {
index 17f39b08704850b8651d82b0525e0eae0012715c..85794a49db68cdbc9a0cee73fcb7d952d316d439 100644 (file)
                                                                <div class="col-fluid">
                                                                        <table id="rrd-table" class="table table-striped table-hover"></table>
                                                                        <div id="rrd-table_toggle"></div>
+                                                                       <div id="rrd-total">Total messages: <span id="rrd-total-value"></span></div>
                                                                </div>
                                                        </div>
 
index bc580299545ed0cbfa66ab5601647742c5c8355b..9ae6a92974c6f980ddebbc4ac1d75fae823733f8 100644 (file)
@@ -135,7 +135,9 @@ function($, D3Evolution, unused) {
     }
 
     function drawRrdTable(data, unit) {
+        var total_messages = 0;
         var rows = data.map(function (curr, i) {
+            total_messages += curr.value;
             return {
                 options: {
                     style: {
@@ -146,6 +148,8 @@ function($, D3Evolution, unused) {
             };
         }, []);
 
+        document.getElementById('rrd-total-value').innerHTML = total_messages;
+
         $('#rrd-table').footable({
             sorting: {
                 enabled: true