improve styling for login box and alert box,

delete modal dialog alert box on close

Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
Arthur Lu 2023-04-28 23:53:38 +00:00
parent 35376e972a
commit 9703faa1fa
2 changed files with 6 additions and 5 deletions

View File

@ -22,7 +22,7 @@
</nav> </nav>
</header> </header>
<main> <main>
<div class="w3-card w3-margin w3-container w3-display-middle"> <div class="w3-card w3-margin w3-container w3-display-middle w3-padding">
<h2 class="w3-center">Proxmox VE Login</h2> <h2 class="w3-center">Proxmox VE Login</h2>
<form> <form>
<label for="username"><b>Username</b></label> <label for="username"><b>Username</b></label>
@ -36,9 +36,6 @@
</div> </div>
</form> </form>
</div> </div>
<div class="w3-container w3-center w3-margin">
<output id="status"> </output>
</div>
</main> </main>
</body> </body>
</html> </html>

View File

@ -52,12 +52,16 @@ export function alert (message) {
`; `;
let dialog = document.createElement("dialog"); let dialog = document.createElement("dialog");
dialog.classList.add("w3-card-4"); dialog.classList.add("w3-card");
dialog.classList.add("w3-container"); dialog.classList.add("w3-container");
dialog.append(form); dialog.append(form);
document.body.append(dialog); document.body.append(dialog);
dialog.showModal(); dialog.showModal();
dialog.addEventListener("close", () => {
dialog.parentElement.removeChild(dialog);
})
} }
customElements.define("dialog-form", Dialog); customElements.define("dialog-form", Dialog);