</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>
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();
if (data.auth === "ok") {
sessionStorage.setItem("read_only", data.read_only);
saveCredentials(password);
- $(dialog).hide();
- $(backdrop).hide();
+ $("#connectForm").off("submit");
+ $("#connectDialog").modal("hide");
displayUI();
}
},