From 3d2c8e13db122711c654ef174c1a01a9232b3d05 Mon Sep 17 00:00:00 2001 From: fish Date: Tue, 28 Jul 2026 14:54:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E7=A7=8D=E7=AE=A1=E7=90=86=E4=BA=A4?= =?UTF-8?q?=E6=98=93=E6=89=80=E5=AD=97=E6=AE=B5=E6=94=AF=E6=8C=81=E4=B8=AD?= =?UTF-8?q?=E8=8B=B1=E5=8F=8C=E8=AF=AD=E5=B1=95=E7=A4=BA=EF=BC=8C=E5=8A=A0?= =?UTF-8?q?=E5=AE=BD=E8=A1=A8=E5=8D=95=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.7 --- ft-app/app/routers/admin.py | 8 +++++++- ft-app/app/templates/admin.html | 14 +++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ft-app/app/routers/admin.py b/ft-app/app/routers/admin.py index 570a28c..89fdd1a 100644 --- a/ft-app/app/routers/admin.py +++ b/ft-app/app/routers/admin.py @@ -9,7 +9,13 @@ from app.collector import ( router = APIRouter(prefix="/admin", tags=["admin"]) -EXCHANGES = ["CZCE", "DCE", "SHFE", "CFFEX", "INE"] +EXCHANGES = [ + ("CZCE", "郑州商品交易所 CZCE"), + ("DCE", "大连商品交易所 DCE"), + ("SHFE", "上海期货交易所 SHFE"), + ("CFFEX", "中国金融期货交易所 CFFEX"), + ("INE", "上海国际能源交易中心 INE"), +] @router.get("/", response_class=HTMLResponse) diff --git a/ft-app/app/templates/admin.html b/ft-app/app/templates/admin.html index 254ab23..fa5e71f 100644 --- a/ft-app/app/templates/admin.html +++ b/ft-app/app/templates/admin.html @@ -20,6 +20,10 @@ {% set tab = request.query_params.get('tab', 'sync') %} +{% set exchange_names = {} %} +{% for ex in exchanges %} +{% set _ = exchange_names.update({ex[0]: ex[1]}) %} +{% endfor %}
@@ -51,7 +55,7 @@ onclick="toggleProduct(this)"> {{ p.code }} · {{ p.name }} - {{ p.exchange }} + {{ exchange_names.get(p.exchange, p.exchange) }} {{ p.contracts|length }} 合约
@@ -86,7 +90,7 @@ {# ═══════════════════ Tab: 品种管理 ═══════════════════ #}
-
+
新建品种
@@ -97,11 +101,11 @@
-
+
@@ -121,7 +125,7 @@ {{ p.code }} {{ p.name }} - {{ p.exchange }} + {{ exchange_names.get(p.exchange, p.exchange) }} {{ p.point_value }} {{ p.contracts|length }}