Files
ops-assistant/templates/login.html
2026-03-19 21:23:28 +08:00

143 lines
3.2 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🛠️ Ops-Assistant - 登录</title>
<style>
:root{
--bg:#0f172a;
--card:#111827;
--text:#e5e7eb;
--muted:#9ca3af;
--border:#1f2937;
--accent:#f97316;
--accent2:#ea580c;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: radial-gradient(1200px 600px at 10% 10%, rgba(249,115,22,.18), transparent 60%),
radial-gradient(900px 500px at 90% 10%, rgba(234,88,12,.18), transparent 60%),
var(--bg);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
color: var(--text);
}
.login-card {
background: var(--card);
border-radius: 16px;
padding: 36px 30px;
width: 100%;
max-width: 380px;
border: 1px solid var(--border);
box-shadow: 0 20px 60px rgba(0,0,0,.35);
animation: slideUp .4s ease;
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
}
.login-logo {
text-align: center;
margin-bottom: 24px;
}
.login-logo .icon { font-size: 48px; }
.login-logo h1 {
font-size: 22px;
color: var(--text);
margin-top: 8px;
}
.login-logo .subtitle {
font-size: 13px;
color: var(--muted);
margin-top: 4px;
}
.form-group {
margin-bottom: 16px;
}
.form-group label {
display: block;
font-size: 13px;
color: var(--muted);
margin-bottom: 6px;
font-weight: 500;
}
.form-group input {
width: 100%;
padding: 12px 14px;
border: 1px solid var(--border);
border-radius: 10px;
font-size: 15px;
transition: border-color .2s, box-shadow .2s;
outline: none;
background: #0b1220;
color: var(--text);
}
.form-group input:focus {
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(249,115,22,.2);
}
.btn-login {
width: 100%;
padding: 12px;
background: linear-gradient(135deg, var(--accent), var(--accent2));
color: #fff;
border: none;
border-radius: 10px;
font-size: 15px;
font-weight: 600;
cursor: pointer;
transition: opacity .2s, transform .1s;
margin-top: 6px;
}
.btn-login:hover { opacity: .9; }
.btn-login:active { transform: scale(.98); }
.error-msg {
background: rgba(239,68,68,.12);
color: #fca5a5;
padding: 10px 14px;
border-radius: 8px;
font-size: 13px;
margin-bottom: 14px;
text-align: center;
border: 1px solid rgba(239,68,68,.3);
}
</style>
</head>
<body>
<div class="login-card">
<div class="login-logo">
<div class="icon">🦞</div>
<h1>Ops-Assistant</h1>
<div class="subtitle">{{.version}}</div>
</div>
{{if .error}}
<div class="error-msg">{{.error}}</div>
{{end}}
<form method="POST" action="/login">
<div class="form-group">
<label>用户名</label>
<input type="text" name="username" placeholder="请输入用户名" autocomplete="username" autofocus required>
</div>
<div class="form-group">
<label>密码</label>
<input type="password" name="password" placeholder="请输入密码" autocomplete="current-password" required>
</div>
<button class="btn-login" type="submit">登录</button>
</form>
</div>
</body>
</html>