diff options
-rw-r--r-- | interface/js/app/config.js | 19 | ||||
-rw-r--r-- | interface/js/app/graph.js | 12 | ||||
-rw-r--r-- | interface/js/app/stats.js | 10 |
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 }]; |