58 lines
2.4 KiB
HTML
58 lines
2.4 KiB
HTML
{{define "login"}}
|
|
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>登录 - MailGo</title>
|
|
{{template "styles" .}}
|
|
</head>
|
|
<body>
|
|
{{template "navbar" .}}
|
|
<div class="container">
|
|
<div style="max-width:400px;margin:80px auto;">
|
|
<div class="card">
|
|
<h2 style="text-align:center;margin-bottom:24px;">MailGo 登录</h2>
|
|
{{if .error}}<div class="alert alert-error">{{.error}}</div>{{end}}
|
|
<form method="POST" action="/login">
|
|
<div class="form-group">
|
|
<label>邮箱地址</label>
|
|
<input type="email" name="email" required autofocus placeholder="admin@example.com">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>密码</label>
|
|
<input type="password" name="password" required placeholder="请输入密码">
|
|
</div>
|
|
<button type="submit" class="btn btn-primary" style="width:100%;">登录</button>
|
|
</form>
|
|
|
|
{{if or .oauth2Enabled .ldapEnabled}}
|
|
<div style="text-align:center;margin:16px 0;color:#7f8c8d;">─── 或 ───</div>
|
|
{{end}}
|
|
|
|
{{if .ldapEnabled}}
|
|
<form method="POST" action="/login/ldap">
|
|
<div class="form-group">
|
|
<label>LDAP 用户名</label>
|
|
<input type="text" name="username" placeholder="LDAP 用户名">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>LDAP 密码</label>
|
|
<input type="password" name="password" placeholder="LDAP 密码">
|
|
</div>
|
|
<button type="submit" class="btn" style="width:100%;background:#8e44ad;color:#fff;">LDAP 登录</button>
|
|
</form>
|
|
{{end}}
|
|
|
|
{{if .oauth2Enabled}}
|
|
<a href="/auth/oauth2" class="btn" style="width:100%;background:#3498db;color:#fff;text-align:center;display:block;margin-top:8px;">
|
|
{{if eq .oauth2Provider "google"}}Google{{else if eq .oauth2Provider "github"}}GitHub{{else}}OAuth2{{end}} 登录
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
{{end}}
|