From: Alexander Moisseev Date: Sat, 28 Jul 2018 08:48:28 +0000 (+0300) Subject: [WebUI] Save symbols to the selected server X-Git-Tag: 1.7.9~29^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F2381%2Fhead;p=rspamd.git [WebUI] Save symbols to the selected server instead of local --- diff --git a/interface/js/app/symbols.js b/interface/js/app/symbols.js index ca5bb3c12..fb69ee1b4 100644 --- a/interface/js/app/symbols.js +++ b/interface/js/app/symbols.js @@ -30,6 +30,11 @@ define(["jquery", "footable"], var ft = {}; var ui = {}; + function getSelector(id) { + var e = document.getElementById(id); + return e.options[e.selectedIndex].value; + } + function saveSymbols(rspamd, action, id, server) { var inputs = $("#" + id + " :input[data-role=\"numerictextbox\"]"); var url = action; @@ -65,6 +70,7 @@ define(["jquery", "footable"], var lookup = {}; var freqs = []; var distinct_groups = []; + var selected_server = getSelector("selSrv"); data.forEach(function (group) { group.rules.forEach(function (item) { @@ -102,8 +108,13 @@ define(["jquery", "footable"], lookup[item.group] = 1; distinct_groups.push(item.group); } - item.save = "" + - " "; + item.save = + " " + + ""; items.push(item); }); }); @@ -239,11 +250,6 @@ define(["jquery", "footable"], }; ui.setup = function (rspamd) { - function getSelector(id) { - var e = document.getElementById(id); - return e.options[e.selectedIndex].value; - } - $("#updateSymbols").on("click", function (e) { e.preventDefault(); var checked_server = getSelector("selSrv");