feat(settings): per-user language preference and panel improvements
Store UI language per user (users.language column, migration 26). Language selector moves from Panel tab to Profile tab — each account picks its own language, saved to DB and applied via i18n.changeLanguage() on save so the interface switches immediately. Panel tab: panel_name read-only (falls back to env PANEL_NAME), log_retention_days field exposed in UI, language selector removed. Panel API accepts panel_name in PUT so it can be overridden in DB without touching the env var. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1366,6 +1366,14 @@ def migrate_proxmox_task_progress(conn):
|
||||
logger.info("✓ proxmox_tasks.progress already exists")
|
||||
|
||||
|
||||
def migrate_user_language(conn):
|
||||
"""Migration 26: Add 'language' column to users table (per-user UI language)."""
|
||||
if add_column_if_not_exists(conn, 'users', 'language', "VARCHAR(10) DEFAULT 'ru'"):
|
||||
logger.info("✓ Added language column to users")
|
||||
else:
|
||||
logger.info("✓ users.language already exists")
|
||||
|
||||
|
||||
def run_all_migrations(engine, db_session=None):
|
||||
"""
|
||||
Run all migrations in order.
|
||||
@@ -1580,6 +1588,14 @@ def run_all_migrations(engine, db_session=None):
|
||||
logger.warning(f"Proxmox task progress migration: {e}")
|
||||
conn.rollback()
|
||||
|
||||
# Migration 26: users.language column
|
||||
try:
|
||||
migrate_user_language(conn)
|
||||
conn.commit()
|
||||
except Exception as e:
|
||||
logger.warning(f"User language migration: {e}")
|
||||
conn.rollback()
|
||||
|
||||
logger.info("=" * 50)
|
||||
logger.info("✓ All migrations completed successfully")
|
||||
logger.info("=" * 50)
|
||||
|
||||
Reference in New Issue
Block a user