$(function () { // Little eye $("body").on("mousedown", ".o_little_eye", function (ev) { $(ev.target) .closest(".input-group") .find(".form-control") .prop("type", (i, old) => { return old === "text" ? "password" : "text"; }); }); // db modal $("body").on("click", ".o_database_action", function (ev) { ev.preventDefault(); const db = $(ev.currentTarget).data("db"); const target = $(ev.currentTarget).data("bsTarget"); $(target).find("input[name=name]").val(db); $(target).modal("show"); }); // close modal on submit $(".modal").on("submit", "form", function (ev) { const form = $(this).closest("form")[0]; if (form && form.checkValidity && !form.checkValidity()) { return; } const modal = $(this).parentsUntil("body", ".modal"); if (modal.hasClass("o_database_backup")) { $(modal).modal("hide"); if (!$(".alert-backup-long").length) { $(".list-group").before( "