diff options
author | moisseev <moiseev@mezonplus.ru> | 2020-08-07 20:03:13 +0300 |
---|---|---|
committer | moisseev <moiseev@mezonplus.ru> | 2020-08-07 20:03:13 +0300 |
commit | 587c5215b6bab63f073fc202dcfe44fa3b84d725 (patch) | |
tree | a49f7e7baae7ac029820f5539a8610561b06a688 /interface/js/app/config.js | |
parent | a170fd6b4c87d41c5e096093e8ee10a762c58290 (diff) | |
download | rspamd-587c5215b6bab63f073fc202dcfe44fa3b84d725.tar.gz rspamd-587c5215b6bab63f073fc202dcfe44fa3b84d725.zip |
[WebUI] Use actions names as labels
Diffstat (limited to 'interface/js/app/config.js')
-rw-r--r-- | interface/js/app/config.js | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/interface/js/app/config.js b/interface/js/app/config.js index 8b391582b..082806088 100644 --- a/interface/js/app/config.js +++ b/interface/js/app/config.js @@ -33,27 +33,14 @@ define(["jquery", "codejar", "linenumbers", "prism"], $("#actionsFormField").empty(); var items = []; $.each(data[0].data, function (i, item) { - var idx = -1; - var label = null; - if (item.action === "greylist") { - label = "Greylist"; - idx = 0; - } else if (item.action === "add header") { - label = "Probably Spam"; - idx = 1; - } else if (item.action === "rewrite subject") { - label = "Rewrite subject"; - idx = 2; - } else if (item.action === "reject") { - label = "Spam"; - idx = 3; - } + var actionsOrder = ["greylist", "add header", "rewrite subject", "reject"]; + var idx = actionsOrder.indexOf(item.action); if (idx >= 0) { items.push({ idx: idx, html: '<div class="form-group">' + - '<label class="col-form-label col-md-2 float-left">' + label + "</label>" + + '<label class="col-form-label col-md-2 float-left">' + item.action + "</label>" + '<div class="controls slider-controls col-md-10">' + '<input class="action-scores form-control" data-id="action" type="number" value="' + item.value + '">' + |