]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Use Footable to draw Throughput summary table 1546/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Tue, 21 Mar 2017 16:25:51 +0000 (19:25 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Tue, 21 Mar 2017 16:25:51 +0000 (19:25 +0300)
interface/css/rspamd.css
interface/js/app/graph.js

index 64550a6298442a54a55f384872f513a95b75bdbc..c867279608069697181808a31771402141f650f6 100644 (file)
@@ -559,13 +559,11 @@ td.maps-cell {
   height: 100%;
   width: 100%;
 }
-#rrd-table_wrapper {
-    z-index: 100;
-}
 #rrd-table {
     width: 100% !important;
     text-align: left;
     font-size: 12px;
+    z-index: 100;
 }
 #rrd-table td {
     padding-top: 2px;
index cfe97b7d50a964f6a15ea01fb49c0c9009bea2b3..5fff7ed818d00115d4a26a8de151dbc2651a5b0f 100644 (file)
@@ -23,7 +23,7 @@
  THE SOFTWARE.
  */
 
-define(['jquery', 'd3evolution', 'datatables'],
+define(['jquery', 'd3evolution', 'footable'],
 function($, D3Evolution, unused) {
     var rrd_pie_config = {
         header: {},
@@ -128,24 +128,30 @@ function($, D3Evolution, unused) {
     }
 
     function drawRrdTable(data, unit) {
-        $('#rrd-table').DataTable({
-            destroy: true,
-            paging: false,
-            searching: false,
-            info: false,
-            data: data,
+        var rows = data.map(function (curr, i) {
+            return {
+                options: {
+                    style: {
+                        color: graph_options.legend.entries[i].color
+                    }
+                },
+                value: curr
+            };
+        }, []);
+
+        $('#rrd-table').footable({
+            sorting: {
+                enabled: true
+            },
             columns: [
-                { data: "label", title: "Action" },
-                { data: "value", title: "Messages",       defaultContent: "" },
-                { data: "min",   title: "Minimum, " + unit, defaultContent: "" },
-                { data: "avg",   title: "Average, " + unit, defaultContent: "" },
-                { data: "max",   title: "Maximum, " + unit, defaultContent: "" },
-                { data: "last",  title: "Last, " + unit },
+                { name: "label", title: "Action" },
+                { name: "value", title: "Messages",         defaultContent: "" },
+                { name: "min",   title: "Minimum, " + unit, defaultContent: "" },
+                { name: "avg",   title: "Average, " + unit, defaultContent: "" },
+                { name: "max",   title: "Maximum, " + unit, defaultContent: "" },
+                { name: "last",  title: "Last, " + unit },
             ],
-
-            "fnRowCallback": function (nRow, aData) {
-                $(nRow).css("color", aData.color);
-            }
+            rows: rows
         });
     }