mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Close GitHub issues and document as roadmaps instead: - #2731: user preferences API - #2732: server settings REST API - #2733: injection fault tracking - packet analysis: protocol-oriented analysis architecture
2.3 KiB
2.3 KiB
This document is a roadmap/planning document. The described features have not been implemented yet.
User Preferences API — Roadmap
Problem
Currently, user-specific preferences (UI theme, language, AI Copilot settings, workspace layout, etc.) can only be stored in browser localStorage. This has several drawbacks:
- localStorage clearing — clearing browser data or switching devices loses all settings
- No cross-device sync — users must reconfigure preferences on each device
- No API access — CLI tools and third-party clients cannot read/write preferences
- Fragile persistence — localStorage can be cleared by browser maintenance or incognito mode
Proposed API
| Method | Path | Description |
|---|---|---|
GET |
/v3/access/users/me/preferences |
Get all preferences for current user |
PUT |
/v3/access/users/me/preferences |
Merge preferences (top-level merge, not replace) |
DELETE |
/v3/access/users/me/preferences |
Clear all preferences |
Storage
A preferences JSON column on the existing users table:
- Type:
JSON, non-nullable, default'{}' - No schema enforcement — clients can store arbitrary key-value pairs
- Examples:
{"theme": "dark", "language": "zh-CN", "copilot_default_mode": "teaching_assistant"}
Implementation Plan
- Add
preferencesJSON column toUserORM model - Create Alembic migration
- Add
UserPreferencesUpdatePydantic schema withextra="allow" - Add
get_user_preferences()andupdate_user_preferences()toUsersRepository - Add three endpoints to
users.pyrouter:GET/PUT/DELETE /me/preferences
Related Files
| File | Role |
|---|---|
gns3server/db/models/user.py |
User ORM model |
gns3server/db/repositories/users.py |
UsersRepository with database operations |
gns3server/api/routes/controller/users.py |
User API router |
gns3server/schemas/ |
Pydantic schemas |
gns3server/db/versions/ |
Alembic migrations |
Status
- Add
preferencesJSON column to User ORM model - Create Alembic migration
- Add
UserPreferencesUpdateschema - Add repository methods
- Add API endpoints to users.py router