feat(webui): show the full token-usage picture in settings (#6638)

This commit is contained in:
chengyongru authored and GitHub committed 2026-11-12 18:13:06 +08:00
1 parent b49218b6a3
commit e6b23c7356
42 files changed
+1116 -342

No files matched your search

+6 -3
View File
@@ -185,9 +185,12 @@ def system_settings_payload(
return payload
def settings_usage_payload(config: Config) -> dict[str, Any]:
"""Return the lightweight token usage slice for Overview refreshes."""
return llm_usage_payload(timezone_name=config.agents.defaults.timezone)
def settings_usage_payload(config: Config, *, details: bool = False) -> dict[str, Any]:
"""Return only the 30-day usage projection currently displayed."""
return llm_usage_payload(
timezone_name=config.agents.defaults.timezone,
view="models" if details else "overview",
)
def update_agent_system_settings(config: Config, query: QueryParams) -> tuple[bool, bool]: