Files
servboard/templates/pages/login.html
T
zhangjie 5b2219f901
/ 自动构建并推送Docker镜像 (push) Failing after 3s
Init
2026-03-25 17:34:00 +08:00

60 lines
2.4 KiB
HTML

{% extends "pages/base.html" %}
{% block header %}{% endblock %}
{% block content %}
<div class="login-container">
<div class="login-logo">
<img src="{{ url_for('static', filename='logo.png') }}" alt="logo" style="width: 80px; height: 80px;">
</div>
<h1>服务罗盘</h1>
<p class="subtitle">服务导航中心</p>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="flash-messages">
{% for category, message in messages %}
<div class="flash {{ category }}">{{ message }}</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<form method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="username" class="password-label">用户名</label>
<div class="input-wrapper">
<input type="text" id="username" name="username" required autofocus placeholder="请输入用户名">
</div>
</div>
<div class="form-group">
<div class="password-field-wrapper">
<label for="password" class="password-label">密码</label>
<div class="input-wrapper">
<input type="password" id="password" name="password" required placeholder="请输入密码">
<button type="button" class="password-toggle" onclick="togglePassword()" title="显示/隐藏密码">🙈</button>
</div>
</div>
</div>
<button type="submit">登录</button>
</form>
</div>
<script src="{{ url_for('static', filename='theme.js') }}"></script>
<script>
function togglePassword() {
const passwordInput = document.getElementById('password');
const toggleBtn = document.querySelector('.password-toggle');
if (passwordInput.type === 'password') {
passwordInput.type = 'text';
toggleBtn.textContent = '👀';
} else {
passwordInput.type = 'password';
toggleBtn.textContent = '🙈';
}
}
</script>
{% endblock %}
</body>
</html>