feat(ui): 3-tab UI per spec — admin dashboard + date filter, personal dashboard, training w/ difficulty, settings profile
Tab 1 Admin overview (/): aggregate stats + DATE FILTER (?from&to), hardest personas, admin quick actions (Users / + Add product). Tab 2 My dashboard (/my/board): per-user win/lose/session summary (works for admin too). Tab 3 Training (/training): product list w/ status + persona count; admins see all groups (draft->analyze/edit), trainees see ready->personas; persona list shows DIFFICULTY (1-5 stars); admins get a Manage-personas button. Settings (/settings): profile (name/email) via new PATCH /api/auth/profile + change password + language. Backend: analytics date filter; profile endpoint; /api/me/board + /api/chat/sessions opened to any authed user. Rebuilt frontend/dist.
This commit is contained in:
@@ -36,6 +36,7 @@ export const api = {
|
||||
login: (username, password) => request('POST', '/api/auth/login', { username, password }),
|
||||
me: () => request('GET', '/api/auth/me'),
|
||||
setup: (b) => request('POST', '/api/auth/setup', b),
|
||||
updateProfile: (b) => request('PATCH', '/api/auth/profile', b),
|
||||
adminCreateUser: (b) => request('POST', '/api/admin/users', b),
|
||||
adminListUsers: () => request('GET', '/api/admin/users'),
|
||||
adminUpdateUser: (username, b) => request('PUT', `/api/admin/users/${username}`, b),
|
||||
@@ -54,5 +55,11 @@ export const api = {
|
||||
weakAreas: () => request('GET', '/api/me/weak-areas'),
|
||||
myPersonas: () => request('GET', '/api/me/personas'),
|
||||
generatePersona: (b) => request('POST', '/api/me/personas/generate', b),
|
||||
analytics: () => request('GET', '/api/analytics'),
|
||||
analytics: (params = {}) => {
|
||||
const qs = new URLSearchParams()
|
||||
if (params.from) qs.set('from', params.from)
|
||||
if (params.to) qs.set('to', params.to)
|
||||
const q = qs.toString()
|
||||
return request('GET', `/api/analytics${q ? `?${q}` : ''}`)
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user