commit 44ed289: [WebUI] Notify user if uploaded data was not learned

Alexander Moisseev moiseev at mezonplus.ru
Thu Dec 27 18:28:12 UTC 2018


Author: Alexander Moisseev
Date: 2018-12-21 11:28:07 +0300
URL: https://github.com/rspamd/rspamd/commit/44ed289c481b302e7f1a5fdb57d90513e68717c5 (refs/pull/2690/head)

[WebUI] Notify user if uploaded data was not learned
#2684

---
 interface/js/app/rspamd.js | 4 ++--
 interface/js/app/upload.js | 5 ++++-
 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);
+                    }
                 }
             });
         }


More information about the Commits mailing list