lxd-dashboard/index.html
matthewalanpenning 2f36c7cf22 v1.0.9
2020-09-15 07:33:23 -04:00

157 lines
3.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu">
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
<title>LXDWARE - Welcome</title>
<style>
body, html {
height: 100%;
margin: 0;
}
.bg {
background-color: #262626;
background-image: linear-gradient(180deg,#262626,#333);
height: 100%;
background-position: center;
background-size: cover;
position: relative;
color: white;
font-family: "Ubuntu", Courier, monospace;
font-size: 25px;
}
.topleft {
position: absolute;
top: 0;
left: 16px;
}
.bottomleft {
position: absolute;
bottom: 0;
left: 16px;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
}
hr {
margin: auto;
width: 40%;
}
a:link {
text-decoration: none;
color:white;
}
a:visited {
text-decoration: none;
color:white;
}
a:hover {
text-decoration: underline;
color:#e95420;
}
a:active {
text-decoration: underline;
color:white;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
input[type=submit] {
background-color: #e95420 !important;
color: #fff !important;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
}
form {
text-align: left;
margin: 25px;
margin-top: 50px;
}
</style>
</head>
<body>
<div class="bg">
<div class="topleft">
<p><a href="https://lxdware.com">LXDWARE</a></p>
</div>
<div class="middle">
<h1>Welcome</h1>
<hr>
<p>Take control of your virtual infrastructure.</p>
<form onsubmit="return false">
Username:
<input type="text" name="username" id="username" autofocus> <br />
Password:
<input type="password" name="password" id="password"> <br />
<input type="submit" onclick="login()" value="Login">
</form>
</div>
<div class="bottomleft">
<p>LXD Dashboard</p>
</div>
</div>
</body>
<script>
function login() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
//Preventing action in no username or password exist to prevent HTTP Basic Auth cached page credentials
if (username != "" && password != ""){
var http = new XMLHttpRequest();
//Generating unique value for url to prevent HTTP Basic Auth cached page credentials from loading cached page without logging in.
var unixTime = Math.round(+new Date()/1000);
var url = "./admin/index.html?authVal=" + unixTime;
http.open("get", url, false, username, password);
http.send();
if (http.status == 200) {
document.location = url;
}
else {
alert("Incorrect username and/or password!");
}
}
return false;
}
</script>
</html>