]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix save map on cluster messages 2382/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sun, 29 Jul 2018 16:12:12 +0000 (19:12 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sun, 29 Jul 2018 16:12:12 +0000 (19:12 +0300)
interface/js/app/config.js

index 8fbaf4fe02204bb9798fa1fd654305f4d37824b4..5bebca62a0bfb849eec89b90554bc57fb1e415b8 100644 (file)
@@ -32,8 +32,9 @@ define(["jquery"],
             $("#modalDialog").modal("hide");
         }
         function save_map_error(rspamd, serv, jqXHR, textStatus, errorThrown) {
+            var serv_name = (typeof serv === "string") ? serv : serv.name;
             rspamd.alertMessage("alert-modal alert-error", "Save map error on " +
-                serv.name + ": " + errorThrown);
+                serv_name + ": " + errorThrown);
         }
         // @upload map from modal
         function saveMap(rspamd, action, id) {
@@ -267,8 +268,12 @@ define(["jquery"],
                 var id = $(form).attr("id");
                 var data = $("#" + id).find("textarea").val();
                 rspamd.query(action, {
-                    success: save_map_success,
-                    error: save_map_error,
+                    success: function () {
+                        save_map_success(rspamd);
+                    },
+                    error: function (serv, jqXHR, textStatus, errorThrown) {
+                        save_map_error(rspamd, serv, jqXHR, textStatus, errorThrown);
+                    },
                     method: "POST",
                     headers: {
                         Map: id,