aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js
diff options
context:
space:
mode:
authormoisseev <moiseev@mezonplus.ru>2020-08-07 20:03:13 +0300
committermoisseev <moiseev@mezonplus.ru>2020-08-07 20:03:13 +0300
commit587c5215b6bab63f073fc202dcfe44fa3b84d725 (patch)
treea49f7e7baae7ac029820f5539a8610561b06a688 /interface/js
parenta170fd6b4c87d41c5e096093e8ee10a762c58290 (diff)
downloadrspamd-587c5215b6bab63f073fc202dcfe44fa3b84d725.tar.gz
rspamd-587c5215b6bab63f073fc202dcfe44fa3b84d725.zip
[WebUI] Use actions names as labels
Diffstat (limited to 'interface/js')
-rw-r--r--interface/js/app/config.js19
-rw-r--r--interface/js/app/graph.js12
-rw-r--r--interface/js/app/stats.js10
3 files changed, 14 insertions, 27 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 + '">' +
diff --git a/interface/js/app/graph.js b/interface/js/app/graph.js
index 624566a8a..d2e3c5ac6 100644
--- a/interface/js/app/graph.js
+++ b/interface/js/app/graph.js
@@ -65,22 +65,22 @@ define(["jquery", "d3evolution", "footable"],
legend: {
space: 140,
entries: [{
- label: "Rejected",
+ label: "reject",
color: "#FF0000"
}, {
- label: "Temporarily rejected",
+ label: "soft reject",
color: "#BF8040"
}, {
- label: "Subject rewritten",
+ label: "rewrite subject",
color: "#FF6600"
}, {
- label: "Probable spam",
+ label: "add header",
color: "#FFAD00"
}, {
- label: "Greylisted",
+ label: "greylist",
color: "#436EEE"
}, {
- label: "Clean",
+ label: "no action",
color: "#66CC00"
}]
}
diff --git a/interface/js/app/stats.js b/interface/js/app/stats.js
index 26ac26b44..18c3a2c08 100644
--- a/interface/js/app/stats.js
+++ b/interface/js/app/stats.js
@@ -146,27 +146,27 @@ define(["jquery", "d3pie"],
var data = creds[checked_server].data.actions;
var new_data = [{
color: "#66CC00",
- label: "Clean",
+ label: "no action",
data: data["no action"],
value: data["no action"]
}, {
color: "#BF8040",
- label: "Temporarily rejected",
+ label: "soft reject",
data: data["soft reject"],
value: data["soft reject"]
}, {
color: "#FFAD00",
- label: "Probable spam",
+ label: "add header",
data: data["add header"],
value: data["add header"]
}, {
color: "#436EEE",
- label: "Greylisted",
+ label: "greylist",
data: data.greylist,
value: data.greylist
}, {
color: "#FF0000",
- label: "Rejected",
+ label: "reject",
data: data.reject,
value: data.reject
}];