Add proper PWA install icons and sim-aware app manifest.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -201,9 +201,18 @@ def register_embed_routes(
|
||||
return resp
|
||||
|
||||
|
||||
def pwa_app_name(exchange_key: str) -> str:
|
||||
"""安装 App / 主屏幕显示名(各所独立标识)."""
|
||||
def pwa_app_name(exchange_key: str, *, is_sim: bool | None = None) -> str:
|
||||
"""安装 App / 主屏幕显示名(各所独立标识;模拟盘带 _sim)."""
|
||||
ex = (exchange_key or "").strip().lower()
|
||||
base = {
|
||||
"binance": "Binance",
|
||||
"okx": "OKX",
|
||||
"gate": "Gate",
|
||||
}.get(ex, "Crypto")
|
||||
if is_sim is True:
|
||||
return f"{base}_sim"
|
||||
if is_sim is False:
|
||||
return f"{base}_live"
|
||||
return {
|
||||
"binance": "Binance 交易系统",
|
||||
"okx": "OKX 交易系统",
|
||||
@@ -211,11 +220,11 @@ def pwa_app_name(exchange_key: str) -> str:
|
||||
}.get(ex, "交易系统")
|
||||
|
||||
|
||||
def embed_context_extras(exchange_key: str) -> dict:
|
||||
def embed_context_extras(exchange_key: str, *, is_sim: bool | None = None) -> dict:
|
||||
return {
|
||||
"order_rule_tips_tpl": order_rule_tips_template(exchange_key),
|
||||
"include_transfer_block": include_transfer_block(exchange_key),
|
||||
"ui_open_guard_enabled": ui_open_guard_enabled(exchange_key),
|
||||
"ui_orphan_recovery_enabled": ui_orphan_recovery_enabled(exchange_key),
|
||||
"pwa_app_name": pwa_app_name(exchange_key),
|
||||
"pwa_app_name": pwa_app_name(exchange_key, is_sim=is_sim),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user