From 5453ce1dcf46bdc0a1a45b41893120837e6578a1 Mon Sep 17 00:00:00 2001 From: fish Date: Fri, 24 Jul 2026 23:12:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E8=A1=8C=E6=83=85=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=95=B0=E6=8D=AE=E6=97=A0=E6=B3=95=E8=A1=A5=E5=85=A8?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ft-app/app/collector.py | 2 -- ft-app/app/routers/contracts.py | 7 ------- ft-app/app/templates/base.html | 9 --------- ft-app/app/templates/index.html | 19 ------------------- 4 files changed, 37 deletions(-) diff --git a/ft-app/app/collector.py b/ft-app/app/collector.py index 03f188d..24dd932 100644 --- a/ft-app/app/collector.py +++ b/ft-app/app/collector.py @@ -31,8 +31,6 @@ def fetch_contract_bars(contract_code: str, start_date: str | None = None) -> li else: d = date.fromisoformat(str(val)[:10]) - if start_date and d <= date.fromisoformat(start_date): - continue bars.append({ "date": d, diff --git a/ft-app/app/routers/contracts.py b/ft-app/app/routers/contracts.py index 43f5a5f..d000023 100644 --- a/ft-app/app/routers/contracts.py +++ b/ft-app/app/routers/contracts.py @@ -35,11 +35,6 @@ def contract_index(request: Request, db: Session = Depends(get_db)): if bar.contract not in contract_bars: contract_bars[bar.contract] = bar - total_bars = db.query(DailyBar).count() - latest_bar = ( - db.query(DailyBar).order_by(DailyBar.date.desc()).first() - ) - template = request.app.state.templates.get_template("index.html") return HTMLResponse( template.render( @@ -47,8 +42,6 @@ def contract_index(request: Request, db: Session = Depends(get_db)): active_nav="contracts", contracts=active_contracts, contract_bars=contract_bars, - total_bars=total_bars, - latest_date=latest_bar.date.strftime("%Y-%m-%d") if latest_bar else "—", ) ) diff --git a/ft-app/app/templates/base.html b/ft-app/app/templates/base.html index f0960eb..0d2b42a 100644 --- a/ft-app/app/templates/base.html +++ b/ft-app/app/templates/base.html @@ -177,15 +177,6 @@ .amp-cell { cursor: pointer; color: var(--accent); font-weight: 600; } .amp-cell:hover { text-decoration: underline; } - /* ── Tags / Chips ── */ - .tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; } - .tag { - padding: 5px 12px; border-radius: 20px; font-size: 0.78rem; - font-weight: 500; cursor: pointer; text-decoration: none; - border: 1px solid var(--border); color: var(--sub); - transition: all .12s; - } - .tag:hover, .tag.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); } diff --git a/ft-app/app/templates/index.html b/ft-app/app/templates/index.html index b6fbec9..61db674 100644 --- a/ft-app/app/templates/index.html +++ b/ft-app/app/templates/index.html @@ -4,27 +4,8 @@ {% block breadcrumb %}合约总览{% endblock %} {% block content %} -
-
-
监控合约
-
{{ contracts|length }}
-
-
-
数据条数
-
{{ total_bars }}
-
-
-
最新日期
-
{{ latest_date }}
-
-
合约列表
-
- {% for c in contracts %} - {{ c }} - {% endfor %} -