]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Destroy symbols table on disconnect
authorAlexander Moisseev <moiseev@mezonplus.ru>
Mon, 27 Aug 2018 16:26:44 +0000 (19:26 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Mon, 27 Aug 2018 16:26:44 +0000 (19:26 +0300)
interface/js/app/rspamd.js
interface/js/app/symbols.js

index 644fbbed66d6e60092d7f70597391761bfec5ee1..5472dc284982009f2b75b00ba2360f80fd868a3d 100644 (file)
@@ -44,9 +44,6 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config,
         $("#statWidgets").empty();
         $("#listMaps").empty();
         $("#modalBody").empty();
-        $("#historyLog tbody").remove();
-        $("#errorsLog tbody").remove();
-        $("#symbolsTable tbody").remove();
     }
 
     function stopTimers() {
@@ -120,7 +117,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config,
             tab_config.getMaps(ui, checked_server);
             break;
         case "#symbols_nav":
-            tab_symbols.getSymbols(ui, checked_server);
+            tab_symbols.getSymbols(ui, tables, checked_server);
             break;
         case "#history_nav":
             tab_history.getHistory(ui, tables);
@@ -290,7 +287,7 @@ function ($, d3pie, visibility, tab_stat, tab_graph, tab_config,
         });
         tab_config.setup(ui);
         tab_history.setup(ui, tables);
-        tab_symbols.setup(ui);
+        tab_symbols.setup(ui, tables);
         tab_upload.setup(ui);
         selData = tab_graph.setup();
     };
index 04b661d994e95bc26038376f83dbe5b60371c3b2..a7d55902e02259a7a483bb68017028789152b4f6 100644 (file)
@@ -27,7 +27,6 @@
 define(["jquery", "footable"],
     function ($) {
         "use strict";
-        var ft = {};
         var ui = {};
 
         function getSelector(id) {
@@ -144,7 +143,7 @@ define(["jquery", "footable"],
             return [items, distinct_groups];
         }
         // @get symbols into modal form
-        ui.getSymbols = function (rspamd, checked_server) {
+        ui.getSymbols = function (rspamd, tables, checked_server) {
             rspamd.query("symbols", {
                 success: function (json) {
                     var data = json[0].data;
@@ -197,7 +196,7 @@ define(["jquery", "footable"],
                             }
                         }
                     });
-                    ft.symbols = FooTable.init("#symbolsTable", {
+                    tables.symbols = FooTable.init("#symbolsTable", {
                         columns: [
                             {sorted: true, direction: "ASC", name:"group", title:"Group", style:{"font-size":"11px"}},
                             {name:"symbol", title:"Symbol", style:{"font-size":"11px"}},
@@ -244,14 +243,14 @@ define(["jquery", "footable"],
                 });
         };
 
-        ui.setup = function (rspamd) {
+        ui.setup = function (rspamd, tables) {
             $("#updateSymbols").on("click", function (e) {
                 e.preventDefault();
                 var checked_server = getSelector("selSrv");
                 rspamd.query("symbols", {
                     success: function (data) {
                         var items = process_symbols_data(data[0].data)[0];
-                        ft.symbols.rows.load(items);
+                        tables.symbols.rows.load(items);
                     },
                     server: (checked_server === "All SERVERS") ? "local" : checked_server
                 });