216 lines
5.8 KiB
HTML
216 lines
5.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<title>Login - Mailcow Alias Manager</title>
|
|
<link rel="icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}">
|
|
<link rel="shortcut icon" type="image/png" href="{{ url_for('static', filename='favicon.png') }}">
|
|
<link rel="apple-touch-icon" href="{{ url_for('static', filename='favicon.png') }}">
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background-color: #1a1a1a;
|
|
color: #e0e0e0;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 100vh;
|
|
padding: 20px;
|
|
}
|
|
|
|
.login-container {
|
|
background-color: #2d2d2d;
|
|
padding: 40px;
|
|
border-radius: 8px;
|
|
border: 1px solid #404040;
|
|
max-width: 400px;
|
|
width: 100%;
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
h1 {
|
|
color: #ffffff;
|
|
margin-bottom: 10px;
|
|
text-align: center;
|
|
font-size: 24px;
|
|
}
|
|
|
|
.subtitle {
|
|
color: #b0b0b0;
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
color: #e0e0e0;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.form-group input {
|
|
width: 100%;
|
|
padding: 12px;
|
|
background-color: #1a1a1a;
|
|
border: 1px solid #404040;
|
|
border-radius: 5px;
|
|
color: #ffffff;
|
|
font-size: 16px;
|
|
transition: border-color 0.3s ease;
|
|
}
|
|
|
|
.form-group input:focus {
|
|
outline: none;
|
|
border-color: #0066cc;
|
|
}
|
|
|
|
.btn {
|
|
width: 100%;
|
|
background-color: #0066cc;
|
|
color: #ffffff;
|
|
border: none;
|
|
padding: 12px 24px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
|
|
.btn:hover {
|
|
background-color: #0052a3;
|
|
}
|
|
|
|
.btn:active {
|
|
background-color: #004080;
|
|
}
|
|
|
|
.error-message {
|
|
color: #f44336;
|
|
margin-top: 15px;
|
|
text-align: center;
|
|
font-size: 14px;
|
|
display: none;
|
|
}
|
|
|
|
.error-message.show {
|
|
display: block;
|
|
}
|
|
|
|
/* Mobile Responsive Styles */
|
|
@media (max-width: 768px) {
|
|
body {
|
|
padding: 15px;
|
|
}
|
|
|
|
.login-container {
|
|
padding: 30px 20px;
|
|
max-width: 100%;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 22px;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.subtitle {
|
|
font-size: 13px;
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.form-group label {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.form-group input {
|
|
font-size: 16px;
|
|
padding: 14px;
|
|
}
|
|
|
|
.btn {
|
|
padding: 14px 24px;
|
|
font-size: 16px;
|
|
}
|
|
}
|
|
|
|
/* Small Mobile Devices */
|
|
@media (max-width: 480px) {
|
|
.login-container {
|
|
padding: 25px 15px;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 20px;
|
|
}
|
|
|
|
.subtitle {
|
|
font-size: 12px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="login-container">
|
|
<h1>Mailcow Alias Manager</h1>
|
|
<p class="subtitle">Please enter your password to continue</p>
|
|
|
|
<form id="loginForm" onsubmit="handleLogin(event)">
|
|
<div class="form-group">
|
|
<label for="password">Password</label>
|
|
<input type="password" id="password" name="password" placeholder="Enter password" required autofocus>
|
|
</div>
|
|
|
|
<button type="submit" class="btn">Login</button>
|
|
|
|
<div id="errorMessage" class="error-message"></div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
async function handleLogin(event) {
|
|
event.preventDefault();
|
|
|
|
const password = document.getElementById('password').value;
|
|
const errorMessage = document.getElementById('errorMessage');
|
|
|
|
try {
|
|
const response = await fetch('/login', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({ password: password })
|
|
});
|
|
|
|
const data = await response.json();
|
|
|
|
if (data.status === 'success') {
|
|
window.location.href = '/';
|
|
} else {
|
|
errorMessage.textContent = data.message;
|
|
errorMessage.classList.add('show');
|
|
document.getElementById('password').value = '';
|
|
document.getElementById('password').focus();
|
|
}
|
|
} catch (error) {
|
|
errorMessage.textContent = 'Login error: ' + error.message;
|
|
errorMessage.classList.add('show');
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|