Browse Source

[Minor] Use consistent object key/value spacing

tags/3.8.0
moisseev 5 months ago
parent
commit
01d048664f

+ 0
- 4
.eslintrc.json View File

@@ -20,9 +20,6 @@
"func-names": "off",
// "func-style": ["error", "declaration"],
"id-length": ["error", { "min": 1 }],
// "@stylistic/key-spacing": ["error", {
// "singleLine": { "afterColon": false }
// }],
"line-comment-position": "off",
"logical-assignment-operators": ["error", "never"],
"max-params": ["warn", 6],
@@ -77,7 +74,6 @@
"sort-vars": "off",

"@stylistic/function-paren-newline": "off",
"@stylistic/key-spacing": "off",
"@stylistic/one-var-declaration-per-line": "off"
}
}

+ 8
- 8
interface/js/app/graph.js View File

@@ -132,12 +132,12 @@ define(["jquery", "app/rspamd", "d3evolution", "d3pie", "d3", "footable"],
enabled: true
},
columns: [
{name:"label", title:"Action"},
{name:"value", title:"Messages", defaultContent:""},
{name:"min", title:"Minimum, <span class=\"unit\">" + unit + "</span>", defaultContent:""},
{name:"avg", title:"Average, <span class=\"unit\">" + unit + "</span>", defaultContent:""},
{name:"max", title:"Maximum, <span class=\"unit\">" + unit + "</span>", defaultContent:""},
{name:"last", title:"Last, " + unit},
{name: "label", title: "Action"},
{name: "value", title: "Messages", defaultContent: ""},
{name: "min", title: "Minimum, <span class=\"unit\">" + unit + "</span>", defaultContent: ""},
{name: "avg", title: "Average, <span class=\"unit\">" + unit + "</span>", defaultContent: ""},
{name: "max", title: "Maximum, <span class=\"unit\">" + unit + "</span>", defaultContent: ""},
{name: "last", title: "Last, " + unit},
],
rows: rows.map(function (curr, i) {
return {
@@ -163,7 +163,7 @@ define(["jquery", "app/rspamd", "d3evolution", "d3pie", "d3", "footable"],
}

function updateWidgets(data) {
let rrd_summary = {rows:[]};
let rrd_summary = {rows: []};
let unit = "msg/s";

if (data) {
@@ -241,7 +241,7 @@ define(["jquery", "app/rspamd", "d3evolution", "d3pie", "d3", "footable"],
complete: function () { $("#refresh").removeAttr("disabled").removeClass("disabled"); },
errorMessage: "Cannot receive throughput data",
errorOnceId: "alerted_graph_",
data: {type:type}
data: {type: type}
});
};


+ 14
- 13
interface/js/app/history.js View File

@@ -59,7 +59,7 @@ define(["jquery", "app/rspamd", "d3", "footable"],
items.push(item);
});

return {items:items};
return {items: items};
}

function columns_v2() {
@@ -382,22 +382,23 @@ define(["jquery", "app/rspamd", "d3", "footable"],
function initErrorsTable(rows) {
rspamd.tables.errors = FooTable.init("#errorsLog", {
columns: [
{
sorted: true,
{sorted: true,
direction: "DESC",
name: "ts",
title: "Time",
style: {"font-size": "11px", "width": 300, "maxWidth": 300},
sortValue: function (val) { return Number(val.options.sortValue); }
},
{name:"type",
title:"Worker type",
breakpoints:"xs sm",
style:{"font-size":"11px", "width":150, "maxWidth":150}},
{name:"pid", title:"PID", breakpoints:"xs sm", style:{"font-size":"11px", "width":110, "maxWidth":110}},
{name:"module", title:"Module", style:{"font-size":"11px"}},
{name:"id", title:"Internal ID", style:{"font-size":"11px"}},
{name:"message", title:"Message", breakpoints:"xs sm", style:{"font-size":"11px"}},
sortValue: function (val) { return Number(val.options.sortValue); }},
{name: "type",
title: "Worker type",
breakpoints: "xs sm",
style: {"font-size": "11px", "width": 150, "maxWidth": 150}},
{name: "pid",
title: "PID",
breakpoints: "xs sm",
style: {"font-size": "11px", "width": 110, "maxWidth": 110}},
{name: "module", title: "Module", style: {"font-size": "11px"}},
{name: "id", title: "Internal ID", style: {"font-size": "11px"}},
{name: "message", title: "Message", breakpoints: "xs sm", style: {"font-size": "11px"}},
],
rows: rows,
paging: {

+ 4
- 4
interface/js/app/rspamd.js View File

@@ -339,7 +339,7 @@ function ($, NProgress) {

$("#preloader").addClass("d-none");
$("#navBar, #mainUI").removeClass("d-none");
$(".nav-tabs-sticky").stickyTabs({initialTab:"#status_nav"});
$(".nav-tabs-sticky").stickyTabs({initialTab: "#status_nav"});
},
errorMessage: "Cannot get server status",
server: "All SERVERS"
@@ -366,7 +366,7 @@ function ($, NProgress) {
const req_params = {
jsonp: false,
data: o.data,
headers: $.extend({Password:getPassword()}, o.headers),
headers: $.extend({Password: getPassword()}, o.headers),
url: neighbours_status[ind].url + req_url,
xhr: function () {
const xhr = $.ajaxSettings.xhr();
@@ -853,7 +853,7 @@ function ($, NProgress) {
full += item.rcpt_mime.join(", ");
shrt += item.rcpt_mime.slice(0, rcpt_lim).join(",&#8203;") + more("rcpt_mime");
}
return {full:full, shrt:shrt};
return {full: full, shrt: shrt};
}

function get_symbol_class(name, score) {
@@ -920,7 +920,7 @@ function ($, NProgress) {
items.push(item);
});

return {items:items, symbols:unsorted_symbols};
return {items: items, symbols: unsorted_symbols};
};

ui.waitForRowsDisplayed = function (table, rows_total, callback, iteration) {

+ 1
- 1
interface/js/app/stats.js View File

@@ -315,7 +315,7 @@ define(["jquery", "app/rspamd", "d3pie", "d3"],
const alerted = "alerted_stats_legacy_" + neighbours_status[e].name;
promises.push($.ajax({
url: neighbours_status[e].url + "auth",
headers: {Password:rspamd.getPassword()},
headers: {Password: rspamd.getPassword()},
success: function (data) {
sessionStorage.removeItem(alerted);
["config_id", "version", "uptime"].forEach(function (p) {

+ 11
- 11
interface/js/app/symbols.js View File

@@ -197,17 +197,17 @@ define(["jquery", "app/rspamd", "footable"],

rspamd.tables.symbols = FooTable.init("#symbolsTable", {
columns: [
{sorted:true, direction:"ASC", name:"group", title:"Group", style:{"font-size":"11px"}},
{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:"time", title:"Avg. time", breakpoints:"xs sm", style:{"font-size":"11px"}},
{name:"save", title:"Save", style:{"font-size":"11px"}},
{sorted: true, direction: "ASC", name: "group", title: "Group", style: {"font-size": "11px"}},
{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: "time", title: "Avg. time", breakpoints: "xs sm", style: {"font-size": "11px"}},
{name: "save", title: "Save", style: {"font-size": "11px"}},
],
rows: items[0],
paging: {

+ 2
- 2
interface/js/app/upload.js View File

@@ -171,7 +171,7 @@ define(["jquery", "app/rspamd"],
rspamd.alertMessage("alert-success", "Data successfully scanned");

const rows_total = $("#historyTable_scan > tbody > tr:not(.footable-detail-row)").length + 1;
const o = rspamd.process_history_v2({rows:[json]}, "scan");
const o = rspamd.process_history_v2({rows: [json]}, "scan");
const items = o.items;
rspamd.symbols.scan.push(o.symbols[0]);

@@ -269,7 +269,7 @@ define(["jquery", "app/rspamd"],
$("#scanForm")[0].reset();
$("#scanResult").hide();
$("#scanOutput tbody").remove();
$("html, body").animate({scrollTop:0}, 1000);
$("html, body").animate({scrollTop: 0}, 1000);
return false;
});


+ 10
- 10
interface/js/main.js View File

@@ -20,17 +20,17 @@ requirejs.config({
stickytabs: "jquery.stickytabs.min"
},
shim: {
app: {deps:["jquery"]},
codejar: {exports: "CodeJar", deps:["linenumbers"]},
bootstrap: {exports:"bootstrap", deps:["jquery"]}, // Popovers require jQuery
d3: {exports:"d3"},
d3evolution: {exports:"D3Evolution", deps:["d3.global", "jquery"]},
d3pie: {exports:"D3Pie", deps:["d3.global", "jquery"]},
fontawesome: {exports: "FontAwesome", deps:["fontawesome_solid"]},
footable: {deps:["bootstrap", "jquery"]},
linenumbers: {exports: "withLineNumbers", deps:["prism"]},
app: {deps: ["jquery"]},
codejar: {exports: "CodeJar", deps: ["linenumbers"]},
bootstrap: {exports: "bootstrap", deps: ["jquery"]}, // Popovers require jQuery
d3: {exports: "d3"},
d3evolution: {exports: "D3Evolution", deps: ["d3.global", "jquery"]},
d3pie: {exports: "D3Pie", deps: ["d3.global", "jquery"]},
fontawesome: {exports: "FontAwesome", deps: ["fontawesome_solid"]},
footable: {deps: ["bootstrap", "jquery"]},
linenumbers: {exports: "withLineNumbers", deps: ["prism"]},
prism: {exports: "Prism"},
stickytabs: {deps:["jquery"]}
stickytabs: {deps: ["jquery"]}
},
waitSeconds: 30,
});

Loading…
Cancel
Save