From: moisseev Date: Tue, 15 Jun 2021 17:47:16 +0000 (+0300) Subject: [Minor] Wait until "auth" Ajax request finishes X-Git-Tag: 3.0~289^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a4fe264d7f4124ac7ee5fcb3ddf47791e9ef2c03;p=rspamd.git [Minor] Wait until "auth" Ajax request finishes --- diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index 7e571602a..2f1b88aa0 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -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) {