tab_config.getMaps(ui);
break;
case "#symbols_nav":
- tab_symbols.getSymbols(ui, tables, checked_server);
+ tab_symbols.getSymbols(ui, checked_server);
break;
case "#history_nav":
tab_history.getHistory(ui, tables, neighbours, checked_server);
}
});
tab_config.setup(ui);
- tab_symbols.setup(ui, tables);
+ tab_symbols.setup(ui);
tab_upload.setup(ui);
selData = tab_graph.setup();
};
return [items, distinct_groups];
}
// @get symbols into modal form
- ui.getSymbols = function (rspamd) {
-
- $.ajax({
- dataType: "json",
- type: "GET",
- url: "symbols",
- jsonp: false,
- beforeSend: function (xhr) {
- xhr.setRequestHeader("Password", rspamd.getPassword());
- },
- success: function (data) {
+ ui.getSymbols = function (rspamd, checked_server) {
+ rspamd.query("symbols",
+ function (json) {
+ var data = json[0].data;
var items = process_symbols_data(data);
FooTable.groupFilter = FooTable.Filtering.extend({
construct : function (instance) {
}
});
},
- error: function (data) {
+ function (data) {
rspamd.alertMessage("alert-modal alert-error", data.statusText);
- }
- });
+ },
+ "GET", {}, {}, {}, (checked_server === "All SERVERS") ? "local" : checked_server
+ );
$("#symbolsTable")
.off("click", ":button")
.on("click", ":button", function () {
};
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();
- $.ajax({
- dataType: "json",
- type: "GET",
- jsonp: false,
- url: "symbols",
- beforeSend: function (xhr) {
- xhr.setRequestHeader("Password", rspamd.getPassword());
- },
- success: function (data) {
- var items = process_symbols_data(data)[0];
+ var checked_server = getSelector("selSrv");
+ rspamd.query("symbols",
+ function (data) {
+ var items = process_symbols_data(data[0].data)[0];
ft.symbols.rows.load(items);
},
- error: function (data) {
+ function (data) {
rspamd.alertMessage("alert-modal alert-error", data.statusText);
- }
- });
+ },
+ "GET", {}, {}, {}, (checked_server === "All SERVERS") ? "local" : checked_server
+ );
});
};