},
"rules": {
"array-bracket-newline": ["error", "consistent"],
+ "brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"camelcase": "off",
"capitalized-comments": "off",
"comma-dangle": ["error", "only-multiline"],
// Temporarily disabled rules
"array-callback-return": "off",
"array-element-newline": "off",
- "brace-style": "off",
"callback-return": "off",
"consistent-return": "off",
"consistent-this": "off",
});
updateWidgets(data);
});
- }
- else {
+ } else {
updateWidgets(neighbours_data[0]);
}
},
return e.rows;
}));
data.version = neighbours_data[0].version;
- }
- else {
+ } else {
// Legacy version
data = [].concat.apply([], neighbours_data);
}
delete ft.history;
}
});
- }
- else {
+ } else {
$.ajax({
dataType: "json",
url: neighbours[checked_server].url + "history",
ui.getHistory(rspamd, tables, neighbours, checked_server);
ui.getErrors(rspamd, tables, neighbours, checked_server);
});
- }
- else {
+ } else {
$.ajax({
dataType: "json",
type: "GET",
$("#learning_nav").hide();
$("#resetHistory").attr("disabled", true);
$("#errors-history").hide();
- }
- else {
+ } else {
ui.read_only = false;
$("#learning_nav").show();
$("#resetHistory").removeAttr("disabled", true);
$("#learning_nav").hide();
$("#resetHistory").attr("disabled", true);
$("#errors-history").hide();
- }
- else {
+ } else {
ui.read_only = false;
$("#learning_nav").show();
$("#resetHistory").removeAttr("disabled", true);
success: function (data) {
if (on_success) {
on_success(data);
- }
- else {
+ } else {
alertMessage("alert-success", "Data saved");
}
},
error: function (jqXHR, textStatus, errorThrown) {
if (on_error) {
on_error("local", jqXHR, textStatus, errorThrown);
- }
- else {
+ } else {
alertMessage("alert-error", "Cannot receive data: " + errorThrown);
}
}
if (neighbours_status.every(function (elt) { return elt.checked; })) {
if (on_success) {
on_success(neighbours_status);
- }
- else {
+ } else {
alertMessage("alert-success", "Request completed");
}
}
if (on_error) {
on_error(neighbours_status[ind],
jqXHR, textStatus, errorThrown);
- }
- else {
+ } else {
alertMessage("alert-error", "Cannot receive data from " +
neighbours_status[ind].host + ": " + errorThrown);
}
function (elt) { return elt.checked; })) {
if (on_success) {
on_success(neighbours_status);
- }
- else {
+ } else {
alertMessage("alert-success", "Request completed");
}
}
if (checked_server === key) {
$("#clusterTable tbody [value=\"" + key + "\"]").prop("checked", true);
$("#selSrv [value=\"" + key + "\"]").prop("selected", true);
- }
- else if (!val.status) {
+ } else if (!val.status) {
$("#clusterTable tbody [value=\"" + key + "\"]").prop("disabled", true);
$("#selSrv [value=\"" + key + "\"]").prop("disabled", true);
}
data: JSON.stringify(values),
dataType: "json",
});
- }
- else {
+ } else {
$.ajax({
data: JSON.stringify(values),
dataType: "json",
if (exp > 0) {
item.frequency = item.frequency.toFixed(2) + "e-" + exp;
- }
- else {
+ } else {
item.frequency = item.frequency.toFixed(2);
}
});
if (json.action === "clean" || "no action") {
action = "label-success";
- }
- else if (json.action === "rewrite subject" || "add header" || "probable spam") {
+ } else if (json.action === "rewrite subject" || "add header" || "probable spam") {
action = "label-warning";
- }
- else if (json.action === "spam") {
+ } else if (json.action === "spam") {
action = "label-danger";
}
var score = "";
if (json.score <= json.required_score) {
score = "label-success";
- }
- else if (json.score >= json.required_score) {
+ } else if (json.score >= json.required_score) {
score = "label-danger";
}
$("<tbody id=\"tmpBody\"><tr>" +