"id-length": ["error", { "min": 1 }],
"indent": ["error", 4, { "SwitchCase": 1 }],
// "max-len": ["error", { "code": 120 }],
+ "key-spacing": ["error", {
+ "singleLine": { "afterColon": false }
+ }],
"max-params": ["warn", 6],
"max-statements": ["warn", 28],
"max-statements-per-line": ["error", { "max": 2 }],
"func-style": "off",
"function-paren-newline": "off",
"guard-for-in": "off",
- "key-spacing": "off",
"line-comment-position": "off",
"max-len": "off",
"max-lines": "off",
$("#modalTitle").html(item.uri);
$("#" + item.map).first().show();
$("#modalDialog .progress").hide();
- $("#modalDialog").modal({backdrop: true, keyboard: "show", show: true});
+ $("#modalDialog").modal({backdrop:true, keyboard:"show", show:true});
if (item.editable === false) {
$("#modalSave").hide();
$("#modalSaveAll").hide();
headers: {
Map: id,
},
- params:{
+ params: {
data: data,
dataType: "text",
},
function initGraph() {
var graph = new D3Evolution("graph", $.extend({}, graph_options, {
- yScale: getSelector("selYScale"),
- type: getSelector("selType"),
+ yScale: getSelector("selYScale"),
+ type: getSelector("selType"),
interpolate: getSelector("selInterpolate"),
- convert: getSelector("selConvert"),
+ convert: getSelector("selConvert"),
}));
$("#selYScale").change(function () {
graph.yScale(this.value);
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
});
},
errorMessage: "Cannot receive throughput data",
errorOnceId: "alerted_graph_",
- data: {type: type}
+ data: {type:type}
});
};
full += item.rcpt_mime.join(", ");
shrt += item.rcpt_mime.slice(0, rcpt_lim).join(",​") + more("rcpt_mime");
}
- return {full: full, shrt: shrt};
+ return {full:full, shrt:shrt};
}
preprocess_item(item);
function initHistoryTable(rspamd, tables, data, items) {
FooTable.actionFilter = FooTable.Filtering.extend({
- construct : function (instance) {
+ construct: function (instance) {
this._super(instance);
this.actions = ["reject", "add header", "greylist",
"no action", "soft reject", "rewrite subject"];
this.def = "Any action";
this.$action = null;
},
- $create : function () {
+ $create: function () {
this._super();
var self = this, $form_grp = $("<div/>", {
- class : "form-group"
+ class: "form-group"
}).append($("<label/>", {
- class : "sr-only",
- text : "Action"
+ class: "sr-only",
+ text: "Action"
})).prependTo(self.$form);
self.$action = $("<select/>", {
- class : "form-control"
+ class: "form-control"
}).on("change", {
- self : self
+ self: self
}, self._onStatusDropdownChanged).append(
$("<option/>", {
- text : self.def
+ text: self.def
})).appendTo($form_grp);
$.each(self.actions, function (i, action) {
self.$action.append($("<option/>").text(action));
});
},
- _onStatusDropdownChanged : function (e) {
+ _onStatusDropdownChanged: function (e) {
var self = e.data.self, selected = $(this).val();
if (selected !== self.def) {
if (selected === "reject") {
}
self.filter();
},
- draw : function () {
+ draw: function () {
this._super();
var action = this.find("action");
if (action instanceof FooTable.Filter) {
function initErrorsTable(tables, rows) {
tables.errors = FooTable.init("#errorsLog", {
columns: [
- {sorted: true, direction: "DESC", name:"ts", title:"Time", style:{"font-size":"11px", "width":300, "maxWidth":300}},
+ {sorted:true, direction:"DESC", name:"ts", title:"Time", style:{"font-size":"11px", "width":300, "maxWidth":300}},
{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"}},
var 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 () {
var xhr = $.ajaxSettings.xhr();
var data = json[0].data;
if (jQuery.isEmptyObject(data)) {
neighbours = {
- local: {
+ local: {
host: window.location.host,
url: window.location.href
}
if (o.server !== "local") {
neighbours_status = [{
name: o.server,
- host: neighbours[o.server].host,
+ host: neighbours[o.server].host,
url: neighbours[o.server].url,
}];
}
if (creds && creds[checked_server]) {
var data = creds[checked_server].data;
var new_data = [{
- color : "#66CC00",
- label : "Clean",
- data : data.clean,
- value : data.clean
+ color: "#66CC00",
+ label: "Clean",
+ data: data.clean,
+ value: data.clean
}, {
- color : "#BF8040",
- label : "Temporarily rejected",
- data : data.soft_reject,
- value : data.soft_reject
+ color: "#BF8040",
+ label: "Temporarily rejected",
+ data: data.soft_reject,
+ value: data.soft_reject
}, {
- color : "#FFAD00",
- label : "Probable spam",
- data : data.probable,
- value : data.probable
+ color: "#FFAD00",
+ label: "Probable spam",
+ data: data.probable,
+ value: data.probable
}, {
- color : "#436EEE",
- label : "Greylisted",
- data : data.greylist,
- value : data.greylist
+ color: "#436EEE",
+ label: "Greylisted",
+ data: data.greylist,
+ value: data.greylist
}, {
- color : "#FF0000",
- label : "Rejected",
- data : data.reject,
- value : data.reject
+ color: "#FF0000",
+ label: "Rejected",
+ data: data.reject,
+ value: data.reject
}];
return rspamd.drawPie(pie, "chart", new_data);
var data = json[0].data;
var items = process_symbols_data(data);
FooTable.groupFilter = FooTable.Filtering.extend({
- construct : function (instance) {
+ construct: function (instance) {
this._super(instance);
this.groups = items[1];
this.def = "Any group";
this.$group = null;
},
- $create : function () {
+ $create: function () {
this._super();
var self = this, $form_grp = $("<div/>", {
- class : "form-group"
+ class: "form-group"
}).append($("<label/>", {
- class : "sr-only",
- text : "Group"
+ class: "sr-only",
+ text: "Group"
})).prependTo(self.$form);
self.$group = $("<select/>", {
- class : "form-control"
+ class: "form-control"
}).on("change", {
- self : self
+ self: self
}, self._onStatusDropdownChanged).append(
$("<option/>", {
- text : self.def
+ text: self.def
})).appendTo($form_grp);
$.each(self.groups, function (i, group) {
self.$group.append($("<option/>").text(group));
});
},
- _onStatusDropdownChanged : function (e) {
+ _onStatusDropdownChanged: function (e) {
var self = e.data.self, selected = $(this).val();
if (selected !== self.def) {
self.addFilter("group", selected, ["group"]);
}
self.filter();
},
- draw : function () {
+ draw: function () {
this._super();
var group = this.find("group");
if (group instanceof FooTable.Filter) {
});
tables.symbols = FooTable.init("#symbolsTable", {
columns: [
- {sorted: true, direction: "ASC", name:"group", title:"Group", 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:"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"}},
],
$("#scanTextSource").val("");
$("#scanResult").hide();
$("#scanOutput tbody").remove();
- $("html, body").animate({scrollTop: 0}, 1000);
+ $("html, body").animate({scrollTop:0}, 1000);
return false;
});
// @init upload
nprogress: "nprogress.min",
},
shim: {
- bootstrap: {exports: "bootstrap", deps: ["jquery"]},
- d3pie: {exports: "d3pie", deps: ["d3.global", "jquery"]},
- d3evolution: {exports: "D3Evolution", deps: ["d3", "jquery"]},
- footable: {deps: ["bootstrap", "jquery"]}
+ bootstrap: {exports:"bootstrap", deps:["jquery"]},
+ d3pie: {exports:"d3pie", deps:["d3.global", "jquery"]},
+ d3evolution: {exports:"D3Evolution", deps:["d3", "jquery"]},
+ footable: {deps:["bootstrap", "jquery"]}
}
});