]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Add fuzzy hashes info
authormoisseev <moiseev@mezonplus.ru>
Sun, 9 Aug 2020 11:32:10 +0000 (14:32 +0300)
committermoisseev <moiseev@mezonplus.ru>
Sun, 9 Aug 2020 11:32:10 +0000 (14:32 +0300)
interface/index.html
interface/js/app/stats.js

index 71314e282f94b7056fcaa365cd06bf6b2817c9a0..bf241176bb0867866779f778bfebab9818fa7bc5 100644 (file)
                                                                        </table>
                                                                </div>
                                                </div>
+                                               <div class="card bg-light shadow my-3">
+                                                       <div class="card-header text-secondary py-2">
+                                                               <span class="icon mr-3"><i class="fas fa-hashtag"></i></span>
+                                                               <span class="h6 font-weight-bolder my-2">Fuzzy hashes</span>
+                                                       </div>
+                                                               <div class="card-body p-0 table-responsive">
+                                                                       <table class="table status-table table-sm table-bordered text-nowrap mb-0" id="fuzzyTable">
+                                                                               <thead class="text-secondary">
+                                                                                       <tr>
+                                                                                               <th>Server name</th>
+                                                                                               <th>Storage</th>
+                                                                                               <th>Hashes</th>
+                                                                                       </tr>
+                                                                               </thead>
+                                                                               <tbody>
+                                                                               </tbody>
+                                                                       </table>
+                                                               </div>
+                                               </div>
                                        </div>
                                        <div class="col-lg-6">
                                                <div class="card bg-light shadow my-3">
index 532aec9220803b66aa4c471502da90446def8329..38578866e760d4b7ba87919b301d6997826eb3ec 100644 (file)
@@ -159,19 +159,33 @@ define(["jquery", "d3pie"],
                       (i === 0 ? '<td rowspan="' + statfiles.length + '">' + server + "</td>" : "") +
                       '<td class="' + cls + '">' + statfile.symbol + "</td>" +
                       '<td class="' + cls + '">' + statfile.type + "</td>" +
-                      '<td class="' + cls + '">' + statfile.revision + "</td>" +
-                      '<td class="' + cls + '">' + statfile.users + "</td></tr>");
+                      '<td class="text-right ' + cls + '">' + statfile.revision + "</td>" +
+                      '<td class="text-right ' + cls + '">' + statfile.users + "</td></tr>");
                 });
             }
-            $("#bayesTable tbody").empty();
+
+            function addFuzzyStorage(server, storages) {
+                var i = 0;
+                $.each(storages, function (storage, hashes) {
+                    $("#fuzzyTable tbody").append("<tr>" +
+                      (i === 0 ? '<td rowspan="' + Object.keys(storages).length + '">' + server + "</td>" : "") +
+                      "<td>" + storage + "</td>" +
+                      '<td class="text-right">' + hashes + "</td></tr>");
+                    i++;
+                });
+            }
+
+            $("#bayesTable tbody, #fuzzyTable tbody").empty();
             if (checked_server === "All SERVERS") {
                 $.each(servers, function (server, val) {
                     if (server !== "All SERVERS") {
                         addStatfiles(server, val.data.statfiles);
+                        addFuzzyStorage(server, val.data.fuzzy_hashes);
                     }
                 });
             } else {
                 addStatfiles(checked_server, data.statfiles);
+                addFuzzyStorage(checked_server, data.fuzzy_hashes);
             }
         }