新增客户端管理功能,包括创建、编辑和删除客户端的API,更新用户管理功能,添加用户创建和编辑页面,优化管理员功能,增强用户和客户端的管理体验。

This commit is contained in:
2025-04-17 02:29:16 +08:00
parent d06e45e5d4
commit ff47bb2f6f
11 changed files with 823 additions and 77 deletions

View File

@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<title>编辑用户 - OIDC OAuth2 管理系统</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-5">
<h2>编辑用户</h2>
{{if .error}}
<div class="alert alert-danger">{{.error}}</div>
{{end}}
<form method="POST" action="/admin/users/{{.user.ID}}/edit">
<div class="mb-3">
<label for="username" class="form-label">用户名</label>
<input type="text" class="form-control" id="username" name="username" value="{{.user.Username}}" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">新密码(留空表示不修改)</label>
<input type="password" class="form-control" id="password" name="password">
</div>
<div class="mb-3">
<label for="email" class="form-label">邮箱</label>
<input type="email" class="form-control" id="email" name="email" value="{{.user.Email}}" required>
</div>
<div class="mb-3 form-check">
<input type="checkbox" class="form-check-input" id="is_active" name="is_active" value="true" {{if .user.IsActive}}checked{{end}}>
<label class="form-check-label" for="is_active">账户激活</label>
</div>
<button type="submit" class="btn btn-primary">保存修改</button>
<a href="/admin/users" class="btn btn-secondary">返回</a>
</form>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>