diff --git a/ft-app/app/templates/index.html b/ft-app/app/templates/index.html index 42ec499..50235f5 100644 --- a/ft-app/app/templates/index.html +++ b/ft-app/app/templates/index.html @@ -5,64 +5,65 @@ {% block content %} -{% for pg in product_groups %} -
-
- - {{ pg.code }} · {{ pg.name }} - {{ pg.exchange }} - {{ pg.contracts|length }} 合约 -
-
- - - {% for c in pg.contracts %} - - - {% if c in contract_bars %} - - - - - - - - {% else %} - - {% endif %} - - - {% endfor %} -
合约日期开盘收盘最高最低振幅次日振幅操作
{{ c }}{{ contract_bars[c].date }}{{ contract_bars[c].open|int }}{{ contract_bars[c].close|int }}{{ contract_bars[c].high|int }}{{ contract_bars[c].low|int }} - {% if contract_bars[c].amp_5d %} - {{ contract_bars[c].amp_5d|int }} - {% else %} - - {% endif %} - - {% if c in contract_next_amp %} - {{ contract_next_amp[c] }} - {% else %} - - {% endif %} - 暂无数据详情 →
-
+{% set active_product = request.query_params.get('product', product_groups[0].code if product_groups else '') %} + + + +
+ {% for pg in product_groups %} + + {{ pg.code }} · {{ pg.name }} + + {% endfor %}
+ +{% for pg in product_groups %} +{% if pg.code == active_product %} +
+ + + {% for c in pg.contracts %} + + + {% if c in contract_bars %} + + + + + + + + {% else %} + + {% endif %} + + + {% endfor %} +
合约日期开盘收盘最高最低振幅次日振幅操作
{{ c }}{{ contract_bars[c].date }}{{ contract_bars[c].open|int }}{{ contract_bars[c].close|int }}{{ contract_bars[c].high|int }}{{ contract_bars[c].low|int }} + {% if contract_bars[c].amp_5d %} + {{ contract_bars[c].amp_5d|int }} + {% else %} + + {% endif %} + + {% if c in contract_next_amp %} + {{ contract_next_amp[c] }} + {% else %} + + {% endif %} + 暂无数据详情 →
+
+{% endif %} {% endfor %} - {% endblock %}