"object-shorthand": "off",
"one-var": ["error", { "initialized": "never" }],
"prefer-arrow-callback": "off",
- "prefer-destructuring": "off",
"prefer-named-capture-group": "off",
"prefer-object-has-own": "off",
"prefer-spread": "off",
$listmaps.closest(".card").hide();
rspamd.query("maps", {
success: function (json) {
- const data = json[0].data;
+ const [{data}] = json;
$listmaps.empty();
$("#modalBody").empty();
const $tbody = $("<tbody>");
.map(function (d) { return d.data; });
if (neighbours_data.length === 1) {
- data = neighbours_data[0];
+ [data] = neighbours_data;
} else {
let time_match = true;
neighbours_data.reduce(function (res, curr, _, arr) {
.map(function (d) { return d.data; });
if (neighbours_data.length && !differentVersions(neighbours_data)) {
let data = {};
- const version = neighbours_data[0].version;
+ const [{version}] = neighbours_data;
if (version) {
data.rows = [].concat.apply([], neighbours_data
.map(function (e) {
$("#legacy-history-badge").show();
}
const o = process_history_data(data);
- const items = o.items;
+ const {items} = o;
rspamd.symbols.history = o.symbols;
if (Object.prototype.hasOwnProperty.call(rspamd.tables, "history") &&
Password: password
},
success: function (json) {
- const data = json[0].data;
+ const [{data}] = json;
$("#connectPassword").val("");
if (data.auth === "ok") {
sessionStorage.setItem("read_only", data.read_only);
if (o.server === "All SERVERS") {
queryServer(neighbours_status, 0, "neighbours", {
success: function (json) {
- const data = json[0].data;
+ const [{data}] = json;
if (jQuery.isEmptyObject(data)) {
neighbours = {
local: {
});
},
_onStatusDropdownChanged: function (e) {
- const self = e.data.self;
+ const {self} = e.data;
const selected = self.$action.val();
if (selected !== self.def) {
const not = self.$not.is(":checked");
$(".dropdown-menu a").click(function (e) {
e.preventDefault();
const classList = $(this).attr("class");
- const menuClass = (/\b(?:dynamic|history|preset)\b/).exec(classList)[0];
+ const [menuClass] = (/\b(?:dynamic|history|preset)\b/).exec(classList);
$(".dropdown-menu a.active." + menuClass).removeClass("active");
$(this).addClass("active");
tabClick("#autoRefresh");
const servers = JSON.parse(sessionStorage.getItem("Credentials"));
let data = {};
if (servers && servers[checked_server]) {
- data = servers[checked_server].data;
+ ({data} = servers[checked_server]);
}
const stat_w = [];
uptime = msToTime(val.data.uptime);
}
if ("version" in val.data) {
- version = val.data.version;
+ ({version} = val.data);
}
if (key === "All SERVERS") {
short_id = "";
const creds = JSON.parse(sessionStorage.getItem("Credentials"));
// Controller doesn't return the 'actions' object until at least one message is scanned
if (creds && creds[checked_server] && creds[checked_server].data.scanned) {
- const actions = creds[checked_server].data.actions;
+ const {actions} = creds[checked_server].data;
["no action", "soft reject", "add header", "rewrite subject", "greylist", "reject"]
.forEach(function (action) {
};
function process_node_stat(e) {
- const data = neighbours_status[e].data;
+ const {data} = neighbours_status[e];
// Controller doesn't return the 'actions' object until at least one message is scanned
if (data.scanned) {
for (const action in neighbours_sum.actions) {
ui.getSymbols = function (checked_server) {
rspamd.query("symbols", {
success: function (json) {
- const data = json[0].data;
+ const [{data}] = json;
const items = process_symbols_data(data);
/* eslint-disable consistent-this, no-underscore-dangle, one-var-declaration-per-line */
FooTable.groupFilter = FooTable.Filtering.extend({
construct: function (instance) {
this._super(instance);
- this.groups = items[1];
+ [,this.groups] = items;
this.def = "Any group";
this.$group = null;
},
});
},
_onStatusDropdownChanged: function (e) {
- const self = e.data.self;
+ const {self} = e.data;
const selected = $(this).val();
if (selected !== self.def) {
self.addFilter("group", selected, ["group"]);
const checked_server = rspamd.getSelector("selSrv");
rspamd.query("symbols", {
success: function (data) {
- const items = process_symbols_data(data[0].data)[0];
+ const [items] = process_symbols_data(data[0].data);
rspamd.tables.symbols.rows.load(items);
},
server: (checked_server === "All SERVERS") ? "local" : checked_server
const rows_total = $("#historyTable_scan > tbody > tr:not(.footable-detail-row)").length + 1;
const o = rspamd.process_history_v2({rows: [json]}, "scan");
- const items = o.items;
+ const {items} = o;
rspamd.symbols.scan.push(o.symbols[0]);
if (Object.prototype.hasOwnProperty.call(rspamd.tables, "scan")) {