Browse Source

Merge pull request #2690 from moisseev/webui

[WebUI] Notify user if uploaded data was not learned
tags/1.9.0
Vsevolod Stakhov 5 years ago
parent
commit
178c262919
No account linked to committer's email address
2 changed files with 6 additions and 5 deletions
  1. 2
    2
      interface/js/app/rspamd.js
  2. 4
    3
      interface/js/app/upload.js

+ 2
- 2
interface/js/app/rspamd.js View File

@@ -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");
}

+ 4
- 3
interface/js/app/upload.js View File

@@ -50,10 +50,11 @@ define(["jquery"],
},
method: "POST",
headers: headers,
success: function (json) {
success: function (json, jqXHR) {
cleanTextUpload(source);
if (json[0].status === true) {
rspamd.alertMessage("alert-success", "Data successfully uploaded");
rspamd.alertMessage("alert-success", "Data successfully uploaded");
if (jqXHR.status !== 200) {
rspamd.alertMessage("alert-info", jqXHR.statusText);
}
}
});

Loading…
Cancel
Save