aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2018-09-15 18:32:40 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2018-09-15 18:32:40 +0300
commitc73e007d787c4df0499cee55b0c03ccd39edc410 (patch)
tree3a657769c1c61451dea8700a72351131d00765f7
parent458642949a14fdabe5c85696f1ee23d50695d07f (diff)
downloadrspamd-c73e007d787c4df0499cee55b0c03ccd39edc410.tar.gz
rspamd-c73e007d787c4df0499cee55b0c03ccd39edc410.zip
[Minor] Drop Crockford's `switch` indentation
-rw-r--r--.eslintrc.json3
-rw-r--r--interface/js/app/history.js44
-rw-r--r--interface/js/app/rspamd.js59
3 files changed, 53 insertions, 53 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index b48d887db..bf4c767c9 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -17,6 +17,7 @@
"func-names": "off",
// "func-style": ["error", "declaration"],
"id-length": ["error", { "min": 1 }],
+ "indent": ["error", 4, { "SwitchCase": 1 }],
// "max-len": ["error", { "code": 120 }],
"max-params": ["warn", 6],
"max-statements": ["warn", 28],
@@ -55,10 +56,8 @@
"callback-return": "off",
"consistent-return": "off",
"consistent-this": "off",
- "default-case": "off",
"func-style": "off",
"function-paren-newline": "off",
- "global-require": "off",
"guard-for-in": "off",
"key-spacing": "off",
"line-comment-position": "off",
diff --git a/interface/js/app/history.js b/interface/js/app/history.js
index 16d4b49d2..fa80a10cd 100644
--- a/interface/js/app/history.js
+++ b/interface/js/app/history.js
@@ -62,30 +62,30 @@ define(["jquery", "footable", "humanize"],
function preprocess_item(item) {
for (var prop in item) {
switch (prop) {
- case "rcpt_mime":
- case "rcpt_smtp":
- escape_HTML_array(item[prop]);
- break;
- case "symbols":
- Object.keys(item.symbols).map(function (key) {
- var sym = item.symbols[key];
- if (!sym.name) {
- sym.name = key;
- }
- sym.name = escapeHTML(sym.name);
- if (sym.description) {
- sym.description = escapeHTML(sym.description);
- }
+ case "rcpt_mime":
+ case "rcpt_smtp":
+ escape_HTML_array(item[prop]);
+ break;
+ case "symbols":
+ Object.keys(item.symbols).map(function (key) {
+ var sym = item.symbols[key];
+ if (!sym.name) {
+ sym.name = key;
+ }
+ sym.name = escapeHTML(sym.name);
+ if (sym.description) {
+ sym.description = escapeHTML(sym.description);
+ }
- if (sym.options) {
- escape_HTML_array(sym.options);
+ if (sym.options) {
+ escape_HTML_array(sym.options);
+ }
+ });
+ break;
+ default:
+ if (typeof (item[prop]) === "string") {
+ item[prop] = escapeHTML(item[prop]);
}
- });
- break;
- default:
- if (typeof (item[prop]) === "string") {
- item[prop] = escapeHTML(item[prop]);
- }
}
}
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js
index 1e41afaaf..e7b86a9c2 100644
--- a/interface/js/app/rspamd.js
+++ b/interface/js/app/rspamd.js
@@ -83,37 +83,38 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config,
}
switch (tab_id) {
- case "#status_nav":
- tab_stat.statWidgets(ui, graphs, checked_server);
- timer_id.status = Visibility.every(10000, function () {
+ case "#status_nav":
tab_stat.statWidgets(ui, graphs, checked_server);
- });
- break;
- case "#throughput_nav":
- tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
-
- var autoRefresh = {
- hourly: 60000,
- daily: 300000
- };
- timer_id.throughput = Visibility.every(autoRefresh[selData] || 3600000, function () {
+ timer_id.status = Visibility.every(10000, function () {
+ tab_stat.statWidgets(ui, graphs, checked_server);
+ });
+ break;
+ case "#throughput_nav":
tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
- });
- break;
- case "#configuration_nav":
- tab_config.getActions(ui, checked_server);
- tab_config.getMaps(ui, checked_server);
- break;
- case "#symbols_nav":
- tab_symbols.getSymbols(ui, tables, checked_server);
- break;
- case "#history_nav":
- tab_history.getHistory(ui, tables);
- tab_history.getErrors(ui, tables);
- break;
- case "#disconnect":
- disconnect();
- break;
+
+ var autoRefresh = {
+ hourly: 60000,
+ daily: 300000
+ };
+ timer_id.throughput = Visibility.every(autoRefresh[selData] || 3600000, function () {
+ tab_graph.draw(ui, graphs, tables, neighbours, checked_server, selData);
+ });
+ break;
+ case "#configuration_nav":
+ tab_config.getActions(ui, checked_server);
+ tab_config.getMaps(ui, checked_server);
+ break;
+ case "#symbols_nav":
+ tab_symbols.getSymbols(ui, tables, checked_server);
+ break;
+ case "#history_nav":
+ tab_history.getHistory(ui, tables);
+ tab_history.getErrors(ui, tables);
+ break;
+ case "#disconnect":
+ disconnect();
+ break;
+ default:
}
setTimeout(function () {