diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-09-16 19:31:14 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2018-09-16 19:31:14 +0300 |
commit | 264c8b3d079012d499dafea682888ad2d3f8265f (patch) | |
tree | 9e4c8da5a341a3729c87f39d8ea82d922aa2f1ac /interface | |
parent | dff3186aa7c0020d0fb3fad7950dbcf4bee6a36f (diff) | |
download | rspamd-264c8b3d079012d499dafea682888ad2d3f8265f.tar.gz rspamd-264c8b3d079012d499dafea682888ad2d3f8265f.zip |
[Minor] Enforce consistent key-value spacing
Diffstat (limited to 'interface')
-rw-r--r-- | interface/js/app/config.js | 4 | ||||
-rw-r--r-- | interface/js/app/graph.js | 20 | ||||
-rw-r--r-- | interface/js/app/history.js | 24 | ||||
-rw-r--r-- | interface/js/app/rspamd.js | 6 | ||||
-rw-r--r-- | interface/js/app/stats.js | 40 | ||||
-rw-r--r-- | interface/js/app/symbols.js | 24 | ||||
-rw-r--r-- | interface/js/app/upload.js | 2 | ||||
-rw-r--r-- | interface/js/main.js | 8 |
8 files changed, 64 insertions, 64 deletions
diff --git a/interface/js/app/config.js b/interface/js/app/config.js index ee950f023..58132dc41 100644 --- a/interface/js/app/config.js +++ b/interface/js/app/config.js @@ -193,7 +193,7 @@ define(["jquery"], $("#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(); @@ -227,7 +227,7 @@ define(["jquery"], headers: { Map: id, }, - params:{ + params: { data: data, dataType: "text", }, diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js index 9776fef0f..319ccda9e 100644 --- a/interface/js/app/graph.js +++ b/interface/js/app/graph.js @@ -94,10 +94,10 @@ define(["jquery", "d3evolution", "footable"], 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); @@ -144,12 +144,12 @@ define(["jquery", "d3evolution", "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 }); @@ -257,7 +257,7 @@ define(["jquery", "d3evolution", "footable"], }, errorMessage: "Cannot receive throughput data", errorOnceId: "alerted_graph_", - data: {type: type} + data: {type:type} }); }; diff --git a/interface/js/app/history.js b/interface/js/app/history.js index 990f60a09..21a6edfc0 100644 --- a/interface/js/app/history.js +++ b/interface/js/app/history.js @@ -151,7 +151,7 @@ define(["jquery", "footable", "humanize"], 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); @@ -511,36 +511,36 @@ define(["jquery", "footable", "humanize"], 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") { @@ -553,7 +553,7 @@ define(["jquery", "footable", "humanize"], } self.filter(); }, - draw : function () { + draw: function () { this._super(); var action = this.find("action"); if (action instanceof FooTable.Filter) { @@ -705,7 +705,7 @@ define(["jquery", "footable", "humanize"], 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"}}, diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index e7b86a9c2..ecd82aad5 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -182,7 +182,7 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config, 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(); @@ -483,7 +483,7 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config, var data = json[0].data; if (jQuery.isEmptyObject(data)) { neighbours = { - local: { + local: { host: window.location.host, url: window.location.href } @@ -509,7 +509,7 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config, if (o.server !== "local") { neighbours_status = [{ name: o.server, - host: neighbours[o.server].host, + host: neighbours[o.server].host, url: neighbours[o.server].url, }]; } diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js index 51e41d788..e9f0b8f2d 100644 --- a/interface/js/app/stats.js +++ b/interface/js/app/stats.js @@ -139,30 +139,30 @@ define(["jquery", "d3pie", "humanize"], 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); diff --git a/interface/js/app/symbols.js b/interface/js/app/symbols.js index a7d55902e..4902efd17 100644 --- a/interface/js/app/symbols.js +++ b/interface/js/app/symbols.js @@ -149,35 +149,35 @@ define(["jquery", "footable"], 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"]); @@ -186,7 +186,7 @@ define(["jquery", "footable"], } self.filter(); }, - draw : function () { + draw: function () { this._super(); var group = this.find("group"); if (group instanceof FooTable.Filter) { @@ -198,11 +198,11 @@ define(["jquery", "footable"], }); 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"}}, ], diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js index 927501248..94659b740 100644 --- a/interface/js/app/upload.js +++ b/interface/js/app/upload.js @@ -161,7 +161,7 @@ define(["jquery"], $("#scanTextSource").val(""); $("#scanResult").hide(); $("#scanOutput tbody").remove(); - $("html, body").animate({scrollTop: 0}, 1000); + $("html, body").animate({scrollTop:0}, 1000); return false; }); // @init upload diff --git a/interface/js/main.js b/interface/js/main.js index db9c52942..0c48d95f5 100644 --- a/interface/js/main.js +++ b/interface/js/main.js @@ -15,10 +15,10 @@ requirejs.config({ 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"]} } }); |