1
0
Fork 0

web - form usability fix

This commit is contained in:
Ruben Meyer 2020-08-31 09:52:41 +02:00
parent 71f6b18b85
commit 7b02cdbaf8
Signed by: rxbn_
GPG Key ID: BE3BF898BE352FE2
2 changed files with 11 additions and 6 deletions

View File

@ -7,7 +7,10 @@ append var
div(class="uk-width-auto uk-width-1-4@s")
.uk-flex.uk-flex-auto.uk-flex-column.uk-flex-center.uk-margin-left.uk-margin-right
h1 Please login
form.uk-form-horizontal
#login_msg.uk-alert(data-uk-alert).uk-hidden
a.uk-close-alt.uk-alert-close(href="#")
p
form.uk-form-horizontal(onsubmit="return loginEvent();")
.uk-margin
label.uk-form-label(for="login_user") Username / Email
.uk-form-controls
@ -16,5 +19,6 @@ append var
label.uk-form-label(for="login_pass") Password
.uk-form-controls
input.uk-input#login_pass(type="password")
a(href="/login").uk-button.uk-button-default Login
input(hidden,type="submit")
button(onclick="login()").uk-button.uk-button-default Login
div(class="uk-width-auto uk-width-1-4@s")

View File

@ -1,7 +1,6 @@
function loginEvent() {
login();
return false;
}
// '/login', login user
function loginEvent() { login(); return false; } // btnEvent handling
function login() {
let user = document.getElementById("login_user").value;
let pass = document.getElementById("login_pass").value;
@ -42,6 +41,7 @@ function login() {
};
};
// '/logout', logout user
function logout() {
let ajax = new XMLHttpRequest();
ajax.open("GET", "/api/logout", true);
@ -58,6 +58,7 @@ setTimeout(function () {
}
}, 100);
// '/authenticate', cancels Authentication
function cancelRequest() {
let ajax = new XMLHttpRequest();
ajax.open("GET", "/api/cancel", true);