feat: hub setting to hide account balances and PnL in monitor
Persist show_account_pnl in hub_settings.json; refine key monitor panel layout with right-aligned live stats and scrollable history (max 8 rows). Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -67,6 +67,7 @@ from settings_store import (
|
||||
enabled_exchanges,
|
||||
env_force_disabled_ids,
|
||||
load_settings,
|
||||
normalize_display_prefs,
|
||||
save_settings,
|
||||
)
|
||||
from hub_web_auth import (
|
||||
@@ -676,8 +677,13 @@ def api_get_settings():
|
||||
return load_settings()
|
||||
|
||||
|
||||
class SettingsDisplayBody(BaseModel):
|
||||
show_account_pnl: bool = True
|
||||
|
||||
|
||||
class SettingsBody(BaseModel):
|
||||
exchanges: list[dict] = Field(default_factory=list)
|
||||
display: SettingsDisplayBody | None = None
|
||||
|
||||
|
||||
@app.post("/api/settings")
|
||||
@@ -691,7 +697,11 @@ def api_save_settings(body: SettingsBody):
|
||||
row["enabled"] = False
|
||||
row.pop("env_disabled", None)
|
||||
to_save.append(row)
|
||||
save_settings({"version": 1, "exchanges": to_save})
|
||||
existing = load_settings()
|
||||
display = normalize_display_prefs(existing.get("display"))
|
||||
if body.display is not None:
|
||||
display = normalize_display_prefs(body.display.model_dump())
|
||||
save_settings({"version": 1, "exchanges": to_save, "display": display})
|
||||
return {"ok": True, "settings": load_settings()}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user