feat: dashboard manifest supports 'supported_games' field, frontend filters by selected game

- DashboardTheme model adds supported_games (default: 'all')
- Built-in dashboards declare game compatibility:
  speedometer/tachometer/gear_indicator -> all
  lap_timer -> forza_horizon_5,forza_horizon_4,forza_motorsport,f1_24
- Dashboard browser filters themes by selected game
- Card shows '全' (all) or '限' (limited) badge
- Updated DASHBOARD_DEV.md with supported_games spec
This commit is contained in:
2026-07-25 15:41:55 +08:00
parent 5e177f4514
commit 2177e65fb4
7 changed files with 46 additions and 10 deletions
+4
View File
@@ -30,6 +30,7 @@ class DashboardTheme:
icon: str = "📊"
aspect_ratio: str = "auto"
render_mode: str = "contain"
supported_games: str = "all"
created_at: str = ""
updated_at: str = ""
is_builtin: bool = False
@@ -46,6 +47,7 @@ class DashboardTheme:
"icon": self.icon,
"aspect_ratio": self.aspect_ratio,
"render_mode": self.render_mode,
"supported_games": self.supported_games,
"created_at": self.created_at,
"updated_at": self.updated_at,
"is_builtin": self.is_builtin,
@@ -67,6 +69,7 @@ class DashboardTheme:
icon=config.get("icon", "📊"),
aspect_ratio=config.get("aspect_ratio", "auto"),
render_mode=config.get("render_mode", "contain"),
supported_games=data.get("supported_games", "all"),
created_at=data.get("created_at", ""),
updated_at=data.get("updated_at", ""),
is_builtin=is_builtin,
@@ -137,6 +140,7 @@ class DashboardManager:
"description": theme.description,
"author": theme.author,
"version": theme.version,
"supported_games": theme.supported_games,
"config": {
"icon": theme.icon,
"aspect_ratio": theme.aspect_ratio,