]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Wait until "auth" Ajax request finishes
authormoisseev <moiseev@mezonplus.ru>
Tue, 15 Jun 2021 17:47:16 +0000 (20:47 +0300)
committermoisseev <moiseev@mezonplus.ru>
Wed, 16 Jun 2021 15:16:13 +0000 (18:16 +0300)
interface/js/app/rspamd.js

index 7e571602a991329974689a06b87d2e50721286e4..2f1b88aa0340d88146a1817f22b4cdb9b6a15cae 100644 (file)
@@ -298,21 +298,22 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_
                 });
                 if (!ui.read_only) tab_selectors.displayUI(ui);
             },
+            complete: function () {
+                if (ui.read_only) {
+                    $(".ro-disable").attr("disabled", true);
+                    $(".ro-hide").hide();
+                } else {
+                    $(".ro-disable").removeAttr("disabled", true);
+                    $(".ro-hide").show();
+                }
+
+                $("#preloader").addClass("d-none");
+                $("#navBar, #mainUI").removeClass("d-none");
+                $(".nav-tabs-sticky").stickyTabs({initialTab:"#status_nav"});
+            },
             errorMessage: "Cannot get server status",
             server: "All SERVERS"
         });
-
-        if (ui.read_only) {
-            $(".ro-disable").attr("disabled", true);
-            $(".ro-hide").hide();
-        } else {
-            $(".ro-disable").removeAttr("disabled", true);
-            $(".ro-hide").show();
-        }
-
-        $("#preloader").addClass("d-none");
-        $("#navBar, #mainUI").removeClass("d-none");
-        $(".nav-tabs-sticky").stickyTabs({initialTab:"#status_nav"});
     }
 
     function alertMessage(alertClass, alertText) {