aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2018-12-21 11:28:07 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2018-12-21 11:28:07 +0300
commit44ed289c481b302e7f1a5fdb57d90513e68717c5 (patch)
tree8207bc16da6c419ae07636db3f806099e57e06aa
parent62d381fdf8086660e03e34ae71155d1e73c87410 (diff)
downloadrspamd-44ed289c481b302e7f1a5fdb57d90513e68717c5.tar.gz
rspamd-44ed289c481b302e7f1a5fdb57d90513e68717c5.zip
[WebUI] Notify user if uploaded data was not learned
#2684
-rw-r--r--interface/js/app/rspamd.js4
-rw-r--r--interface/js/app/upload.js5
2 files changed, 6 insertions, 3 deletions
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js
index 29bbfbcf1..b0b2c4568 100644
--- a/interface/js/app/rspamd.js
+++ b/interface/js/app/rspamd.js
@@ -219,11 +219,11 @@ function ($, D3pie, visibility, NProgress, tab_stat, tab_graph, tab_config,
errorMessage();
}
},
- complete: function () {
+ complete: function (jqXHR) {
if (neighbours_status.every(function (elt) { return elt.checked; })) {
if (neighbours_status.some(function (elt) { return elt.status; })) {
if (o.success) {
- o.success(neighbours_status);
+ o.success(neighbours_status, jqXHR);
} else {
alertMessage("alert-success", "Request completed");
}
diff --git a/interface/js/app/upload.js b/interface/js/app/upload.js
index e7ea56cf6..f77cb7e78 100644
--- a/interface/js/app/upload.js
+++ b/interface/js/app/upload.js
@@ -50,9 +50,12 @@ define(["jquery"],
},
method: "POST",
headers: headers,
- success: function (json) {
+ success: function (json, jqXHR) {
cleanTextUpload(source);
rspamd.alertMessage("alert-success", "Data successfully uploaded");
+ if (jqXHR.status !== 200) {
+ rspamd.alertMessage("alert-info", jqXHR.statusText);
+ }
}
});
}