1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00

Minor changes

This commit is contained in:
Donald Cheng Hong Zou 2022-02-28 13:29:17 -05:00
parent f9dc9ebdb3
commit 3bb86493cc
4 changed files with 35 additions and 13 deletions

View File

@ -679,7 +679,7 @@ def signin():
if "message" in session: if "message" in session:
message = session['message'] message = session['message']
session.pop("message") session.pop("message")
return render_template('signin.html', message=message) return render_template('signin.html', message=message, version=DASHBOARD_VERSION)
# Sign Out # Sign Out

View File

@ -1,5 +1,6 @@
body { body {
font-size: .875rem; font-size: .875rem;
/*font-family: 'Poppins', sans-serif;*/
} }
.feather { .feather {
@ -407,8 +408,26 @@ main{
.btn{ .btn{
border-radius: 8px; border-radius: 8px;
/*padding: 0.6rem 0.9em;*/
} }
#username, #password{
padding: 0.6rem calc( 0.9rem + 32px );
height: inherit;
}
label[for="username"], label[for="password"]{
font-size: 1rem;
margin: 0 !important;
transform: translateY(30px) translateX(16px);
padding: 0;
}
/*label[for="password"]{*/
/* transform: translateY(32px) translateX(16px);*/
/*}*/
.modal-content{ .modal-content{
border-radius: 10px; border-radius: 10px;
} }

File diff suppressed because one or more lines are too long

View File

@ -14,29 +14,32 @@
<div class="container-fluid login-container-fluid"> <div class="container-fluid login-container-fluid">
<main role="main" class="container login-container"> <main role="main" class="container login-container">
<div class="login-box" style="margin: auto !important;"> <div class="login-box" style="margin: auto !important;">
<h1 class="text-center">Sign In</h1> <h1 class="text-center">Sign in</h1>
<h5 class="text-center">to WGDashboard</h5>
<form style="margin-left: auto !important; margin-right: auto !important; max-width: 500px;" action="/auth" method="post"> <form style="margin-left: auto !important; margin-right: auto !important; max-width: 500px;" action="/auth" method="post">
{% if message != "" %} {% if message != "" %}
<div class="alert alert-warning" role="alert">You need to sign in first</div> <div class="alert alert-warning" role="alert">You need to sign in first</div>
{% endif %} {% endif %}
<div class="alert alert-danger d-none" role="alert"></div> <div class="alert alert-danger d-none" role="alert" style="margin-top: 1rem; margin-bottom: 0rem;"></div>
<div class="form-group"> <div class="form-group">
<label for="username" class="text-left" style="font-size: 1rem"><i class="bi bi-person-circle"></i> Username</label> <label for="username" class="text-left" style="font-size: 1rem"><i class="bi bi-person-circle"></i></label>
<input type="text" class="form-control" id="username" name="username" required> <input type="text" class="form-control" id="username" name="username" placeholder="Your username" required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password" class="text-left" style="font-size: 1rem"><i class="bi bi-key-fill"></i> Password</label> <label for="password" class="text-left" style="font-size: 1rem"><i class="bi bi-key-fill"></i></label>
<input type="password" class="form-control" id="password" name="password" required> <input type="password" class="form-control" id="password" name="password" placeholder="Your password" required>
</div> </div>
<button type="submit" class="btn btn-dark" style="width: 100%;">Sign In</button> <button type="submit" class="btn btn-dark" style="width: 100%">Sign In</button>
</form> </form>
</div> </div>
</main> </main>
</div> </div>
<small class="text-muted" style="position: fixed; bottom: 0; width: 100%; text-align: center; margin-bottom: 2rem">Version: {{ version }}</small>
</body> </body>
{% include "footer.html" %} {% include "footer.html" %}
<script> <script>
$("button").on("click", function(e){ let loginButton = $('button[type="submit"]');
loginButton.on("click", function(e){
e.preventDefault(); e.preventDefault();
let $password = $("#password"); let $password = $("#password");
let $username = $("#username"); let $username = $("#username");
@ -44,7 +47,7 @@
let check = true let check = true
for (let i = 0; i < req.length; i++){ for (let i = 0; i < req.length; i++){
if ($(req[i]).val().length === 0){ if ($(req[i]).val().length === 0){
$("button").html("Sign In"); loginButton.html("Sign In");
check = false; check = false;
$(req[i]).addClass("is-invalid"); $(req[i]).addClass("is-invalid");
break; break;
@ -69,8 +72,8 @@
window.location.replace("/"); window.location.replace("/");
} }
}else{ }else{
$(".alert").html(res.msg).removeClass("d-none"); $(".alert").html(res.msg).removeClass("d-none").fadeIn();
$("button").html("Sign In").removeAttr("disabled"); loginButton.html("Sign In").removeAttr("disabled");
$("input[required]").addClass("is-invalid"); $("input[required]").addClass("is-invalid");
} }
}); });