白名单仅一币时选择币种默认显示 env 币种(关键位/实盘下单共用)。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,10 +4,13 @@
|
||||
{% endif %}
|
||||
{% macro trade_policy_symbol(name, id, value='', required=true, placeholder='BTC 或 BTC/USDT') -%}
|
||||
{% if trade_policy.symbol_restrict_enabled and trade_policy.symbol_whitelist %}
|
||||
<select name="{{ name }}" id="{{ id }}" {% if required %}required{% endif %} class="trade-policy-symbol-select">
|
||||
<option value="">选择币种</option>
|
||||
{% for sym in trade_policy.symbol_whitelist %}
|
||||
<option value="{{ sym }}" {% if value and ((value|upper) == sym or (value|upper).startswith(sym ~ '/')) %}selected{% endif %}>{{ sym }}/USDT</option>
|
||||
{% set wl = trade_policy.symbol_whitelist %}
|
||||
{% set sole_sym = wl[0] if (wl|length) == 1 else '' %}
|
||||
{% set effective = value if value else sole_sym %}
|
||||
<select name="{{ name }}" id="{{ id }}" {% if required %}required{% endif %} class="trade-policy-symbol-select"{% if sole_sym %} data-sole-symbol="{{ sole_sym }}"{% endif %}>
|
||||
{% if not sole_sym %}<option value="">选择币种</option>{% endif %}
|
||||
{% for sym in wl %}
|
||||
<option value="{{ sym }}" {% if effective and ((effective|upper) == sym or (effective|upper).startswith(sym ~ '/')) %}selected{% endif %}>{{ sym }}/USDT</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user