aboutsummaryrefslogtreecommitdiffstats
path: root/interface
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2018-07-28 11:48:28 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2018-07-28 11:48:28 +0300
commit228af8b2241f62676fe01c3f078548e3881d72c2 (patch)
tree3dad6aa55a87dca3e94855e12b787fb018eb76cc /interface
parent0084098849fbd39806e190a1589f91cacee8167a (diff)
downloadrspamd-228af8b2241f62676fe01c3f078548e3881d72c2.tar.gz
rspamd-228af8b2241f62676fe01c3f078548e3881d72c2.zip
[WebUI] Save symbols to the selected server
instead of local
Diffstat (limited to 'interface')
-rw-r--r--interface/js/app/symbols.js20
1 files changed, 13 insertions, 7 deletions
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 = "<button type=\"button\" data-save=\"local\" class=\"btn btn-primary btn-sm mb-disabled\">Save</button>" +
- "&nbsp;<button data-save=\"All SERVERS\" type=\"button\" class=\"btn btn-primary btn-sm mb-disabled\">Save in cluster</button>";
+ item.save =
+ "<button data-save=\"" + selected_server +
+ "\" title=\"Save changes to the selected server\" " +
+ "type=\"button\" class=\"btn btn-primary btn-sm mb-disabled\">Save</button>&nbsp;" +
+ "<button data-save=\"All SERVERS" +
+ "\" title=\"Save changes to all servers\" " +
+ "type=\"button\" class=\"btn btn-primary btn-sm mb-disabled\">Save in cluster</button>";
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");