134 lines
3.0 KiB
HTML
134 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Docs Login</title>
|
|
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
background: #0d1117;
|
|
color: #c9d1d9;
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
height: 100vh;
|
|
}
|
|
|
|
.login-container {
|
|
background: #161b22;
|
|
padding: 40px;
|
|
border-radius: 12px;
|
|
border: 1px solid #30363d;
|
|
width: 320px;
|
|
box-shadow: 0 0 20px rgba(0,0,0,0.5);
|
|
}
|
|
|
|
h2 {
|
|
text-align: center;
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.input-group {
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
input {
|
|
width: 90%;
|
|
padding: 10px;
|
|
border-radius: 6px;
|
|
border: 1px solid #30363d;
|
|
background: #0d1117;
|
|
color: #c9d1d9;
|
|
outline: none;
|
|
font-size: 14px;
|
|
}
|
|
|
|
input:focus {
|
|
border-color: #58a6ff;
|
|
}
|
|
|
|
button {
|
|
width: 100%;
|
|
padding: 10px;
|
|
background: #238636;
|
|
border: none;
|
|
border-radius: 6px;
|
|
color: white;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: 0.2s;
|
|
}
|
|
|
|
button:hover {
|
|
background: #2ea043;
|
|
}
|
|
|
|
.error {
|
|
margin-top: 10px;
|
|
color: #f85149;
|
|
font-size: 13px;
|
|
text-align: center;
|
|
}
|
|
|
|
.footer {
|
|
margin-top: 20px;
|
|
text-align: center;
|
|
font-size: 12px;
|
|
color: #8b949e;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="login-container">
|
|
<h2>Docs Login</h2>
|
|
|
|
<div class="input-group">
|
|
<input id="username" placeholder="Username">
|
|
</div>
|
|
|
|
<div class="input-group">
|
|
<input id="password" type="password" placeholder="Password">
|
|
</div>
|
|
|
|
<button onclick="login()">Login</button>
|
|
|
|
<div id="error" class="error"></div>
|
|
|
|
<div class="footer">
|
|
Internal Documentation Access
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
async function login() {
|
|
const errorDiv = document.getElementById("error");
|
|
errorDiv.textContent = "";
|
|
|
|
const res = await fetch('/api/docs/login', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({
|
|
username: document.getElementById('username').value,
|
|
password: document.getElementById('password').value
|
|
}),
|
|
credentials: "include"
|
|
});
|
|
|
|
if (res.ok) {
|
|
window.location.href = "/Documentation/home.html";
|
|
} else {
|
|
errorDiv.textContent = "Invalid username or password";
|
|
}
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html> |