mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-30 19:46:38 +08:00
feat: make user limit configurable from admin user management (#18)
Store the per-instance user cap in settings (default 20) and expose GET/PUT /admin/users/limit endpoints. The user management page now lets admins view and update the limit without touching system settings. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: truewhile <truewhile@users.noreply.github.com>
This commit is contained in:
+17
-1
@@ -64,8 +64,24 @@ export interface SystemUpdateStatus {
|
||||
started_at?: string
|
||||
}
|
||||
|
||||
export interface UserListResponse {
|
||||
users: User[]
|
||||
max_users: number
|
||||
current_users: number
|
||||
}
|
||||
|
||||
export interface UserLimitResponse {
|
||||
max_users: number
|
||||
current_users: number
|
||||
}
|
||||
|
||||
export const adminAPI = {
|
||||
listUsers: () => api.get<User[]>('/admin/users').then((r) => r.data),
|
||||
listUsers: () => api.get<UserListResponse>('/admin/users').then((r) => r.data),
|
||||
|
||||
getUserLimit: () => api.get<UserLimitResponse>('/admin/users/limit').then((r) => r.data),
|
||||
|
||||
updateUserLimit: (maxUsers: number) =>
|
||||
api.put<UserLimitResponse>('/admin/users/limit', { max_users: maxUsers }).then((r) => r.data),
|
||||
|
||||
createUser: (payload: { username: string; password: string }) =>
|
||||
api.post<User>('/admin/users', payload).then((r) => r.data),
|
||||
|
||||
Reference in New Issue
Block a user