refactor: unify three-exchange instance UI with shared templates
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -44,7 +44,16 @@ def order_rule_tips_template(exchange_key: str) -> str:
|
||||
|
||||
|
||||
def include_transfer_block(exchange_key: str) -> bool:
|
||||
return (exchange_key or "").strip().lower() == "gate"
|
||||
"""三所 standalone / embed 壳均在顶栏展示划转区块。"""
|
||||
return (exchange_key or "").strip().lower() in ORDER_RULE_TIPS_BY_EXCHANGE
|
||||
|
||||
|
||||
def ui_open_guard_enabled(exchange_key: str) -> bool:
|
||||
return (exchange_key or "").strip().lower() == "okx"
|
||||
|
||||
|
||||
def ui_orphan_recovery_enabled(exchange_key: str) -> bool:
|
||||
return (exchange_key or "").strip().lower() == "binance"
|
||||
|
||||
|
||||
def path_to_embed_tab(path: str) -> str | None:
|
||||
@@ -144,4 +153,6 @@ def embed_context_extras(exchange_key: str) -> 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),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user