define(["jquery"],
function($) {
- var interface = {}
+ var interface = {};
function save_map_success(rspamd) {
rspamd.alertMessage("alert-modal alert-success", "Map data successfully saved");
error: function (data) {
save_map_error(rspamd, "local", null, null, data.statusText);
},
- success: function() {save_map_success(rspamd)},
+ success: function() {save_map_success(rspamd);},
});
}
// @get maps id
function getMaps(rspamd) {
var items = [];
- var $listmaps = $("#listMaps")
+ var $listmaps = $("#listMaps");
$listmaps.closest(".widget-box").hide();
$.ajax({
dataType: "json",
dataType: "text",
});
});
- }
+ };
interface.getActions = getActions;
interface.getMaps = getMaps;
};
escape_HTML_array = function (arr) {
- arr.forEach(function (d, i) { arr[i] = EscapeHTML(d) });
+ arr.forEach(function (d, i) { arr[i] = EscapeHTML(d); });
};
function unix_time_format(tm) {
}
};
- items.push(item)
+ items.push(item);
});
return items;
"title": description
});
});
- }
+ };
if (checked_server === "All SERVERS") {
rspamd.queryNeighbours("history", function (req_data) {
}
var neighbours_data = req_data
- .filter(function (d) { return d.status }) // filter out unavailable neighbours
+ .filter(function (d) { return d.status; }) // filter out unavailable neighbours
.map(function (d){ return d.data; });
if (neighbours_data.length && !differentVersions()) {
var data = {};
rspamd.queryNeighbours("errors", function (req_data) {
var neighbours_data = req_data
.filter(function (d) {
- return d.status
+ return d.status;
}) // filter out unavailable neighbours
.map(function (d) {
return d.data;
define(["jquery", "footable"],
function($) {
- var interface = {}
- var ft = {}
+ var interface = {};
+ var ft = {};
function saveSymbols(rspamd, action, id, is_cluster) {
var inputs = $("#" + id + " :input[data-role=\"numerictextbox\"]");
if (item.weight > max) {
max = item.weight * 2;
}
- item.group = group.group
+ item.group = group.group;
if (item.weight < min) {
min = item.weight * 2;
}
min + "\" max=\"" +
max + "\" step=\"" + decimalStep(item.weight) +
"\" tabindex=\"1\" value=\"" + Number(item.weight).toFixed(3) +
- "\" id=\"_sym_" + item.symbol + "\"></input>"
+ "\" id=\"_sym_" + item.symbol + "\"></input>";
if (!item.time) {
item.time = 0;
}
- item.time = Number(item.time).toFixed(2) + "s"
+ item.time = Number(item.time).toFixed(2) + "s";
if (!item.frequency) {
item.frequency = 0;
}
freqs.push(item.frequency);
- item.frequency = Number(item.frequency).toFixed(2)
+ item.frequency = Number(item.frequency).toFixed(2);
if (!(item.group in lookup)) {
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>" +
" <button data-save=\"cluster\" type=\"button\" class=\"btn btn-primary btn-sm mb-disabled\">Save in cluster</button>";
- items.push(item)
+ items.push(item);
});
});
item.frequency = item.frequency.toFixed(2);
}
});
- return [items, distinct_groups]
+ return [items, distinct_groups];
}
// @get symbols into modal form
interface.getSymbols = function(rspamd, tables, checked_server) {
{"name":"symbol","title":"Symbol","style":{"font-size":"11px"}},
{"name":"description","title":"Description","breakpoints":"xs sm","style":{"font-size":"11px"}},
{"name":"weight","title":"Score","style":{"font-size":"11px"}},
- {"name":"frequency","title":"Frequency","breakpoints":"xs sm","style":{"font-size":"11px"},"sortValue": function(value){return Number(value).toFixed(2)}},
+ {"name":"frequency","title":"Frequency","breakpoints":"xs sm","style":{"font-size":"11px"},"sortValue": function(value){return Number(value).toFixed(2);}},
{"name":"time","title":"Avg. time","breakpoints":"xs sm","style":{"font-size":"11px"}},
{"name":"save","title":"Save","style":{"font-size":"11px"}},
],
});
$(document).on("click", "#symbolsTable :button", function(event){
var value = $(this).data("save");
- if (!value) return
+ if (!value) return;
saveSymbols(rspamd, "./savesymbols", "symbolsTable", value == "cluster");
});
};