]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Fix login modal 3427/head
authormoisseev <moiseev@mezonplus.ru>
Thu, 9 Jul 2020 14:50:51 +0000 (17:50 +0300)
committermoisseev <moiseev@mezonplus.ru>
Thu, 9 Jul 2020 14:50:51 +0000 (17:50 +0300)
interface/index.html
interface/js/app/rspamd.js

index 3b2f1f2ca4a23ba458fdc089f860d6b7f53f76b4..f235671918a5f3c6464915f6eb41b9cabd6b5578 100644 (file)
 </div>
 
 <!-- login modal -->
-<div id="connectDialog" class="modal" tabindex="-1" role="dialog" style="display: none;">
+<div id="connectDialog" class="modal fade" data-backdrop="static" data-keyboard="false" role="dialog">
        <div class="modal-dialog modal-sm modal-dialog-centered">
                <div class="modal-content shadow">
-                       <div class="modal-header py-2">
-                               <h6 class="modal-title">Login to Rspamd</h6>
+                       <div class="modal-header text-secondary py-2">
+                               <i class="fas fa-key my-auto"></i><h6 class="modal-title font-weight-bolder">Login to Rspamd</h6>
                        </div>
                        <div class="modal-body" id="connectBody">
                                <form id="connectForm">
        </div>
 </div>
 
-<div id="backDrop" class="modal-backdrop fade in" style="display: none;"></div>
 <script data-main="./js/main.js" src="./js/lib/require.min.js"></script>
 </body>
 </html>
index e48a75318256a341b09a1807e411d4d05e4ea3de..be7594e300f1b7e16a0d08b5a5b07f330c0a8f27 100644 (file)
@@ -452,13 +452,12 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_
                 displayUI();
             },
             error: function () {
-                var dialog = $("#connectDialog");
-                var backdrop = $("#backDrop");
-                $("#mainUI").hide();
-                $(dialog).show();
-                $(backdrop).show();
-                $("#connectPassword").focus();
-                $("#connectForm").off("submit");
+                $("#connectDialog")
+                    .on("shown.bs.modal", function () {
+                        $("#connectDialog").off("shown.bs.modal");
+                        $("#connectPassword").focus();
+                    })
+                    .modal("show");
 
                 $("#connectForm").on("submit", function (e) {
                     e.preventDefault();
@@ -479,8 +478,8 @@ function ($, D3pie, visibility, NProgress, stickyTabs, tab_stat, tab_graph, tab_
                             if (data.auth === "ok") {
                                 sessionStorage.setItem("read_only", data.read_only);
                                 saveCredentials(password);
-                                $(dialog).hide();
-                                $(backdrop).hide();
+                                $("#connectForm").off("submit");
+                                $("#connectDialog").modal("hide");
                                 displayUI();
                             }
                         },