600 lines
18 KiB
HTML
600 lines
18 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="vi">
|
|
|
|
<head>
|
|
<script>
|
|
var savedTheme = localStorage.getItem('audit_theme');
|
|
if (savedTheme === 'dark' || (!savedTheme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
document.documentElement.setAttribute('data-theme', 'dark');
|
|
} else {
|
|
document.documentElement.setAttribute('data-theme', 'light');
|
|
}
|
|
</script>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="icon" type="image/png" href="{{ url_for('icon', path='/icon.png') }}">
|
|
<title>Đăng nhập - Công cụ Kiểm tra Hardening - VNPT-MEDIA</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
--bg-main: #f4f6f9;
|
|
--card-bg: #ffffff;
|
|
--text-main: #2b3445;
|
|
--text-muted: #7d879c;
|
|
--border-color: #e3e9ef;
|
|
--border-color-light: #f1f5f9;
|
|
--primary-color: #1976d2;
|
|
--hover-bg: #f8f9fa;
|
|
--input-bg: #ffffff;
|
|
--input-text: #2b3445;
|
|
--input-border: #ced4da;
|
|
--empty-state-bg: #f8f9fa;
|
|
--success-color: #2e7d32;
|
|
--success-bg: #e8f5e9;
|
|
--danger-color: #c62828;
|
|
--danger-bg: #ffebee;
|
|
--warning-color: #e65100;
|
|
--warning-bg: #fff3e0;
|
|
--info-color: #0277bd;
|
|
--info-bg: #e1f5fe;
|
|
}
|
|
|
|
[data-theme="dark"] {
|
|
--bg-main: #0f172a;
|
|
--card-bg: #1e293b;
|
|
--text-main: #f1f5f9;
|
|
--text-muted: #94a3b8;
|
|
--border-color: #334155;
|
|
--border-color-light: #1e293b;
|
|
--primary-color: #3b82f6;
|
|
--hover-bg: #334155;
|
|
--input-bg: #0f172a;
|
|
--input-text: #f1f5f9;
|
|
--input-border: #475569;
|
|
--empty-state-bg: #1e293b;
|
|
--success-color: #4caf50;
|
|
--success-bg: rgba(76, 175, 80, 0.1);
|
|
--danger-color: #ef5350;
|
|
--danger-bg: rgba(244, 67, 54, 0.1);
|
|
--warning-color: #ff9800;
|
|
--warning-bg: rgba(255, 152, 0, 0.1);
|
|
--info-color: #29b6f6;
|
|
--info-bg: rgba(3, 169, 244, 0.1);
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
background: var(--bg-main);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: flex-start;
|
|
align-items: center;
|
|
padding: 20px 10px;
|
|
position: relative;
|
|
overflow-x: hidden;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
body::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: -50%;
|
|
left: -50%;
|
|
width: 200%;
|
|
height: 200%;
|
|
background:
|
|
linear-gradient(135deg, transparent 0%, transparent 48%, rgba(33, 150, 243, 0.05) 48%, rgba(33, 150, 243, 0.05) 52%, transparent 52%, transparent 100%),
|
|
linear-gradient(45deg, transparent 0%, transparent 48%, rgba(33, 150, 243, 0.08) 48%, rgba(33, 150, 243, 0.08) 52%, transparent 52%, transparent 100%),
|
|
linear-gradient(135deg, transparent 0%, transparent 48%, rgba(33, 150, 243, 0.03) 48%, rgba(33, 150, 243, 0.03) 52%, transparent 52%, transparent 100%);
|
|
background-size: 300px 300px, 400px 400px, 500px 500px;
|
|
background-position: 0 0, 100px 100px, 200px 0;
|
|
z-index: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
body::after {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0;
|
|
right: 0;
|
|
width: 0;
|
|
height: 0;
|
|
border-style: solid;
|
|
border-width: 0 400px 400px 0;
|
|
border-color: transparent rgba(33, 150, 243, 0.03) transparent transparent;
|
|
z-index: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.menu-icon {
|
|
position: absolute;
|
|
top: 20px;
|
|
right: 20px;
|
|
width: 40px;
|
|
height: 40px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-around;
|
|
cursor: pointer;
|
|
padding: 8px;
|
|
}
|
|
|
|
.menu-icon span {
|
|
width: 100%;
|
|
height: 3px;
|
|
background: #1976d2;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.login-container {
|
|
background: var(--card-bg);
|
|
border-radius: 15px;
|
|
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
|
|
padding: 50px 55px;
|
|
width: 100%;
|
|
max-width: 480px;
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
|
|
.logo {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
width: 100%;
|
|
gap: 0;
|
|
margin-bottom: 35px;
|
|
padding-bottom: 20px;
|
|
border-bottom: 2px solid var(--sub-tab-border);
|
|
}
|
|
|
|
.logo img {
|
|
width: 65px;
|
|
height: 65px;
|
|
object-fit: contain;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.logo-text {
|
|
flex: 1;
|
|
font-size: 30px;
|
|
font-weight: 800;
|
|
color: var(--primary-color);
|
|
letter-spacing: 0.35em;
|
|
text-align: center;
|
|
white-space: nowrap;
|
|
padding-right: 0.35em; /* compensate last letter-spacing */
|
|
}
|
|
|
|
.logo-icon {
|
|
display: inline-block;
|
|
width: 60px;
|
|
height: 60px;
|
|
background: #1976d2;
|
|
border-radius: 50% 0 50% 50%;
|
|
position: relative;
|
|
margin-right: 10px;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.logo-icon::after {
|
|
content: '';
|
|
position: absolute;
|
|
width: 30px;
|
|
height: 30px;
|
|
background: var(--card-bg);
|
|
border-radius: 50%;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group input {
|
|
width: 100%;
|
|
padding: 14px 18px;
|
|
background-color: var(--input-bg);
|
|
color: var(--text-main);
|
|
border: 1px solid var(--input-border);
|
|
border-radius: 6px;
|
|
font-size: 15px;
|
|
transition: border-color 0.3s;
|
|
}
|
|
|
|
.form-group input:focus {
|
|
outline: none;
|
|
border-color: var(--primary-color);
|
|
}
|
|
|
|
.form-group input::placeholder {
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
.password-wrapper {
|
|
position: relative;
|
|
}
|
|
|
|
.password-wrapper input {
|
|
padding-right: 45px;
|
|
}
|
|
|
|
.password-toggle {
|
|
position: absolute;
|
|
right: 12px;
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
cursor: pointer;
|
|
color: var(--text-muted);
|
|
font-size: 18px;
|
|
}
|
|
|
|
.btn-login {
|
|
width: 100%;
|
|
padding: 14px;
|
|
background: #1976d2;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 6px;
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.3s;
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.btn-login:hover {
|
|
background: #1565c0;
|
|
}
|
|
|
|
/* SSO Portal Button */
|
|
.sso-divider {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin: 20px 0;
|
|
color: var(--text-muted);
|
|
font-size: 13px;
|
|
}
|
|
.sso-divider::before,
|
|
.sso-divider::after {
|
|
content: '';
|
|
flex: 1;
|
|
height: 1px;
|
|
background-color: var(--border-color);
|
|
}
|
|
|
|
.btn-sso {
|
|
width: 100%;
|
|
padding: 14px;
|
|
background: linear-gradient(135deg, #0d47a1, #1976d2);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 6px;
|
|
font-size: 15px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.3s;
|
|
letter-spacing: 0.5px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 10px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.btn-sso:hover {
|
|
background: linear-gradient(135deg, #1565c0, #1e88e5);
|
|
box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.sso-info {
|
|
margin-top: 10px;
|
|
padding: 10px 14px;
|
|
background-color: var(--info-bg);
|
|
border-radius: 6px;
|
|
border-left: 3px solid #1976d2;
|
|
font-size: 12px;
|
|
color: var(--primary-color);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.help-text {
|
|
margin-top: 30px;
|
|
padding-top: 20px;
|
|
border-top: 1px solid #eee;
|
|
font-size: 12px;
|
|
color: var(--text-muted);
|
|
line-height: 1.8;
|
|
}
|
|
|
|
.help-text a {
|
|
color: var(--primary-color);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.help-text a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.help-text strong {
|
|
color: var(--danger-color);
|
|
}
|
|
|
|
.footer {
|
|
position: absolute;
|
|
bottom: 20px;
|
|
text-align: center;
|
|
color: var(--primary-color);
|
|
font-size: 13px;
|
|
z-index: 1;
|
|
}
|
|
|
|
.footer strong {
|
|
color: var(--danger-color);
|
|
}
|
|
|
|
.alert {
|
|
padding: 12px;
|
|
border-radius: 5px;
|
|
margin-bottom: 20px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.alert-error {
|
|
background-color: var(--danger-bg);
|
|
color: var(--danger-color);
|
|
border: 1px solid #ef9a9a;
|
|
}
|
|
|
|
.alert-success {
|
|
background-color: var(--success-bg);
|
|
color: var(--success-color);
|
|
border: 1px solid #a5d6a7;
|
|
}
|
|
|
|
/* Responsive Styles */
|
|
@media screen and (max-width: 768px) {
|
|
.login-container {
|
|
padding: 30px 25px;
|
|
}
|
|
|
|
.logo-text {
|
|
font-size: 38px;
|
|
letter-spacing: 5px;
|
|
}
|
|
|
|
.logo-icon {
|
|
width: 50px;
|
|
height: 50px;
|
|
}
|
|
|
|
.logo-icon::after {
|
|
width: 25px;
|
|
height: 25px;
|
|
}
|
|
|
|
.footer {
|
|
position: relative;
|
|
bottom: auto;
|
|
margin-top: 20px;
|
|
}
|
|
}
|
|
|
|
@media screen and (max-width: 480px) {
|
|
body {
|
|
padding: 10px 5px;
|
|
}
|
|
|
|
.login-container {
|
|
padding: 25px 20px;
|
|
border-radius: 12px;
|
|
}
|
|
|
|
.logo {
|
|
margin-bottom: 25px;
|
|
}
|
|
|
|
.logo-text {
|
|
font-size: 32px;
|
|
letter-spacing: 4px;
|
|
}
|
|
|
|
.logo-icon {
|
|
width: 40px;
|
|
height: 40px;
|
|
}
|
|
|
|
.logo-icon::after {
|
|
width: 20px;
|
|
height: 20px;
|
|
}
|
|
|
|
.form-group input {
|
|
padding: 10px 12px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.btn-login {
|
|
padding: 10px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.btn-guest {
|
|
padding: 10px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.help-text {
|
|
font-size: 11px;
|
|
margin-top: 20px;
|
|
padding-top: 15px;
|
|
}
|
|
|
|
.footer {
|
|
font-size: 11px;
|
|
position: relative;
|
|
bottom: auto;
|
|
margin-top: 15px;
|
|
}
|
|
|
|
.menu-icon {
|
|
top: 10px;
|
|
right: 10px;
|
|
width: 35px;
|
|
height: 35px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="menu-icon">
|
|
<span></span>
|
|
<span></span>
|
|
<span></span>
|
|
</div>
|
|
|
|
<div class="login-container">
|
|
<div class="logo">
|
|
<img src="{{ url_for('icon', path='/icon.png') }}" alt="VNPT-MEDIA Logo">
|
|
<span class="logo-text">VNPT-MEDIA</span>
|
|
</div>
|
|
|
|
{% if message %}
|
|
<div class="alert alert-{{ message.type }}">
|
|
{{ message.text }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form method="post" action="login" id="loginForm">
|
|
<div class="form-group">
|
|
<div style="position: relative;">
|
|
<input
|
|
type="email"
|
|
id="emailInput"
|
|
name="username"
|
|
placeholder="ten.nv@vnpt.vn"
|
|
required
|
|
autocomplete="email"
|
|
style="padding-left: 44px;"
|
|
oninput="validateEmailDomain(this)"
|
|
>
|
|
<span style="position:absolute;left:14px;top:50%;transform:translateY(-50%);font-size:17px;pointer-events:none;">✉️</span>
|
|
</div>
|
|
<div id="emailHint" style="margin-top:6px;font-size:12px;color: var(--danger-color);display:none;">
|
|
⚠️ Vui lòng nhập email có đuôi <strong>@vnpt.vn</strong>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="password-wrapper">
|
|
<input type="password" id="password" name="password" placeholder="Mật khẩu" required autocomplete="current-password">
|
|
<span class="password-toggle" onclick="togglePassword()">👁</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: nowrap;">
|
|
<span style="font-size: 14px; color: var(--text-muted); white-space: nowrap;">🔐 Mã xác thực 2FA (OTP)</span>
|
|
<span style="
|
|
background: linear-gradient(135deg, #1565c0, #1976d2);
|
|
color: white;
|
|
padding: 2px 10px;
|
|
border-radius: 10px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
white-space: nowrap;
|
|
flex-shrink: 0;
|
|
">RADIUS</span>
|
|
</div>
|
|
<input type="text" name="otp" id="otp"
|
|
maxlength="6" pattern="[0-9]*" inputmode="numeric"
|
|
autocomplete="one-time-code"
|
|
style="letter-spacing: 8px; text-align: center; font-size: 18px; font-weight: 600;">
|
|
</div>
|
|
|
|
<button type="submit" class="btn-login">🔑 Đăng nhập qua RADIUS</button>
|
|
</form>
|
|
|
|
{% if sso_enabled %}
|
|
<div class="sso-divider">hoặc</div>
|
|
|
|
<div style="text-align:center; margin-bottom: 10px;">
|
|
<div class="sso-info">
|
|
🌐 <strong>Đăng nhập qua SSO Portal:</strong><br>
|
|
Truy cập hệ thống bằng tài khoản tập đoàn VNPT-MEDIA.<br>
|
|
SSO Portal sẽ tự động chuyển hướng bạn về đây sau khi xác thực.
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<script>
|
|
function togglePassword() {
|
|
const passwordInput = document.getElementById('password');
|
|
const toggle = document.querySelector('.password-toggle');
|
|
|
|
if (passwordInput.type === 'password') {
|
|
passwordInput.type = 'text';
|
|
toggle.textContent = '🙈';
|
|
} else {
|
|
passwordInput.type = 'password';
|
|
toggle.textContent = '👁';
|
|
}
|
|
}
|
|
|
|
// Validate domain @vnpt.vn khi người dùng gõ
|
|
function validateEmailDomain(input) {
|
|
const hint = document.getElementById('emailHint');
|
|
const val = input.value.trim().toLowerCase();
|
|
// Chỉ hiện cảnh báo khi người dùng đã gõ @ nhưng domain sai
|
|
if (val.includes('@') && !val.endsWith('@vnpt.vn')) {
|
|
hint.style.display = 'block';
|
|
input.style.borderColor = '#e53935';
|
|
} else {
|
|
hint.style.display = 'none';
|
|
input.style.borderColor = '';
|
|
}
|
|
}
|
|
|
|
// Chặn submit nếu domain sai
|
|
document.getElementById('loginForm').addEventListener('submit', function(e) {
|
|
const emailVal = document.getElementById('emailInput').value.trim().toLowerCase();
|
|
if (!emailVal.endsWith('@vnpt.vn')) {
|
|
e.preventDefault();
|
|
document.getElementById('emailHint').style.display = 'block';
|
|
document.getElementById('emailInput').style.borderColor = '#e53935';
|
|
document.getElementById('emailInput').focus();
|
|
}
|
|
});
|
|
|
|
// Auto-focus OTP field after password
|
|
document.getElementById('password').addEventListener('keydown', function(e) {
|
|
if (e.key === 'Tab' || e.key === 'Enter') {
|
|
if (e.key === 'Enter') e.preventDefault();
|
|
document.getElementById('otp').focus();
|
|
}
|
|
});
|
|
|
|
// OTP: only allow digits
|
|
document.getElementById('otp').addEventListener('input', function(e) {
|
|
this.value = this.value.replace(/[^0-9]/g, '');
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|