Phase 6: PDF & Polish — PDF generation, admin users/settings, AI tool
Backend: - Setting + GeneratedPdf models, Alembic migration with default settings seed - PDF generation service (WeasyPrint + Jinja2 with autoescape) - Health report HTML template with memory entries + document excerpts - Admin user management: list, create, update (role/max_chats/is_active) - Admin settings: self_registration_enabled, default_max_chats - Self-registration check wired into auth register endpoint - default_max_chats applied to new user registrations - AI tool: generate_pdf creates health compilation PDFs - PDF compile/list/download API endpoints - WeasyPrint system deps added to Dockerfile Frontend: - PDF reports page with generate + download - Admin users page with create/edit/activate/deactivate - Admin settings page with self-registration toggle + max chats - Extended sidebar with PDF reports + admin users/settings links - English + Russian translations for all new UI Review fixes applied: - Jinja2 autoescape enabled (XSS prevention in PDFs) - db.refresh after flush (created_at populated correctly) - storage_path removed from API response (no internal path leak) - Role field uses Literal["user", "admin"] validation - React hooks called before conditional returns (rules of hooks) - default_max_chats setting now applied during registration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,8 @@
|
||||
"users": "Users",
|
||||
"context": "Context",
|
||||
"skills": "Skills",
|
||||
"personal_context": "My Context"
|
||||
"personal_context": "My Context",
|
||||
"pdf": "PDF Reports"
|
||||
},
|
||||
"dashboard": {
|
||||
"welcome": "Welcome, {{name}}",
|
||||
@@ -152,6 +153,27 @@
|
||||
"low": "Low"
|
||||
}
|
||||
},
|
||||
"pdf": {
|
||||
"title": "PDF Reports",
|
||||
"generate": "Generate PDF",
|
||||
"title_placeholder": "Report title...",
|
||||
"no_pdfs": "No PDF reports generated yet."
|
||||
},
|
||||
"admin_users": {
|
||||
"title": "User Management",
|
||||
"create": "Create User",
|
||||
"edit": "Edit User",
|
||||
"max_chats": "Max Chats",
|
||||
"deactivate": "Deactivate",
|
||||
"activate": "Activate"
|
||||
},
|
||||
"admin_settings": {
|
||||
"title": "App Settings",
|
||||
"self_registration": "Self Registration",
|
||||
"self_registration_desc": "Allow users to register accounts themselves",
|
||||
"default_max_chats": "Default Max Chats",
|
||||
"default_max_chats_desc": "Default chat limit for new users"
|
||||
},
|
||||
"common": {
|
||||
"loading": "Loading...",
|
||||
"error": "An error occurred",
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
"users": "Пользователи",
|
||||
"context": "Контекст",
|
||||
"skills": "Навыки",
|
||||
"personal_context": "Мой контекст"
|
||||
"personal_context": "Мой контекст",
|
||||
"pdf": "PDF отчёты"
|
||||
},
|
||||
"dashboard": {
|
||||
"welcome": "Добро пожаловать, {{name}}",
|
||||
@@ -152,6 +153,27 @@
|
||||
"low": "Низкая"
|
||||
}
|
||||
},
|
||||
"pdf": {
|
||||
"title": "PDF отчёты",
|
||||
"generate": "Сгенерировать PDF",
|
||||
"title_placeholder": "Название отчёта...",
|
||||
"no_pdfs": "PDF отчёты ещё не создавались."
|
||||
},
|
||||
"admin_users": {
|
||||
"title": "Управление пользователями",
|
||||
"create": "Создать пользователя",
|
||||
"edit": "Редактировать пользователя",
|
||||
"max_chats": "Макс. чатов",
|
||||
"deactivate": "Деактивировать",
|
||||
"activate": "Активировать"
|
||||
},
|
||||
"admin_settings": {
|
||||
"title": "Настройки приложения",
|
||||
"self_registration": "Самостоятельная регистрация",
|
||||
"self_registration_desc": "Разрешить пользователям самим создавать аккаунты",
|
||||
"default_max_chats": "Лимит чатов по умолчанию",
|
||||
"default_max_chats_desc": "Лимит чатов для новых пользователей"
|
||||
},
|
||||
"common": {
|
||||
"loading": "Загрузка...",
|
||||
"error": "Произошла ошибка",
|
||||
|
||||
Reference in New Issue
Block a user