alphasift 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- alphasift/__init__.py +52 -0
- alphasift/__main__.py +7 -0
- alphasift/audit.py +191 -0
- alphasift/candidate_context.py +738 -0
- alphasift/cli.py +2797 -0
- alphasift/config.py +705 -0
- alphasift/context.py +672 -0
- alphasift/daily.py +1256 -0
- alphasift/daily_brief.py +593 -0
- alphasift/daily_report.py +1115 -0
- alphasift/daily_report_html.py +1257 -0
- alphasift/doctor.py +1123 -0
- alphasift/dsa.py +302 -0
- alphasift/dsa_adapter.py +178 -0
- alphasift/dsa_provider.py +192 -0
- alphasift/evaluate.py +2418 -0
- alphasift/filter.py +517 -0
- alphasift/hotspot.py +1713 -0
- alphasift/industry.py +959 -0
- alphasift/llm_client.py +349 -0
- alphasift/market_digest.py +284 -0
- alphasift/market_news.py +446 -0
- alphasift/market_regime.py +578 -0
- alphasift/markets.py +160 -0
- alphasift/mcp.py +720 -0
- alphasift/models.py +315 -0
- alphasift/normalize.py +113 -0
- alphasift/notify.py +2608 -0
- alphasift/overview.py +225 -0
- alphasift/pack.py +1470 -0
- alphasift/pack_features.py +431 -0
- alphasift/pattern_replay.py +1449 -0
- alphasift/patterns/bottom_volume_yang.yaml +32 -0
- alphasift/patterns/box_breakout.yaml +36 -0
- alphasift/patterns/double_bottom_breakout.yaml +38 -0
- alphasift/patterns/ma20_shrink_pullback.yaml +37 -0
- alphasift/patterns/shooting_star_confirm.yaml +49 -0
- alphasift/patterns/single_yang_hold.yaml +44 -0
- alphasift/patterns/steady_trend_breakout.yaml +39 -0
- alphasift/patterns/three_white_soldiers.yaml +72 -0
- alphasift/patterns/three_white_soldiers_pullback.yaml +91 -0
- alphasift/patterns.py +1233 -0
- alphasift/performance_history.py +297 -0
- alphasift/pipeline.py +1010 -0
- alphasift/post_analysis.py +337 -0
- alphasift/ranker.py +990 -0
- alphasift/report.py +379 -0
- alphasift/result_schema.py +179 -0
- alphasift/risk.py +452 -0
- alphasift/run_history.py +164 -0
- alphasift/scorer.py +597 -0
- alphasift/server.py +680 -0
- alphasift/snapshot.py +1025 -0
- alphasift/snapshot_us.py +280 -0
- alphasift/snapshot_yahoo.py +358 -0
- alphasift/source_guard.py +70 -0
- alphasift/source_history.py +306 -0
- alphasift/store.py +294 -0
- alphasift/strategies/balanced_alpha.yaml +76 -0
- alphasift/strategies/blue_chip_income.yaml +87 -0
- alphasift/strategies/capital_heat.yaml +74 -0
- alphasift/strategies/dual_low.yaml +80 -0
- alphasift/strategies/global_value.yaml +65 -0
- alphasift/strategies/low_volatility_quality.yaml +95 -0
- alphasift/strategies/momentum_quality.yaml +81 -0
- alphasift/strategies/oversold_reversal.yaml +75 -0
- alphasift/strategies/quality_value.yaml +80 -0
- alphasift/strategies/shrink_pullback.yaml +77 -0
- alphasift/strategies/us_momentum_quality.yaml +74 -0
- alphasift/strategies/volume_breakout.yaml +78 -0
- alphasift/strategy.py +1090 -0
- alphasift/strategy_cards.py +424 -0
- alphasift/strategy_templates.py +291 -0
- alphasift/timeutil.py +38 -0
- alphasift/valuation_kr.py +149 -0
- alphasift/workbench_ui.py +1051 -0
- alphasift-0.3.1.data/data/.env.example +151 -0
- alphasift-0.3.1.data/data/LICENSE +184 -0
- alphasift-0.3.1.data/data/SKILL.md +190 -0
- alphasift-0.3.1.data/data/agents/openai.yaml +7 -0
- alphasift-0.3.1.dist-info/METADATA +312 -0
- alphasift-0.3.1.dist-info/RECORD +86 -0
- alphasift-0.3.1.dist-info/WHEEL +5 -0
- alphasift-0.3.1.dist-info/entry_points.txt +2 -0
- alphasift-0.3.1.dist-info/licenses/LICENSE +184 -0
- alphasift-0.3.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1051 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""Self-contained zero-dependency local interactive Workbench UI for ``alphasift serve``."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def render_workbench_html() -> str:
|
|
8
|
+
"""Return a single-file offline-safe HTML workbench interacting with local JSON endpoints."""
|
|
9
|
+
return """<!doctype html>
|
|
10
|
+
<html lang="en" data-theme="dark">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="utf-8">
|
|
13
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
14
|
+
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2032%2032%27%3E%3Crect%20width%3D%2732%27%20height%3D%2732%27%20rx%3D%278%27%20fill%3D%27%23090d16%27%2F%3E%3Cpath%20d%3D%27M6%208h20l-7.5%208.8v6.6l-5%202.4V16.8L6%208z%27%20fill%3D%27%233b82f6%27%20fill-opacity%3D%27.25%27%20stroke%3D%27%2360a5fa%27%20stroke-width%3D%272.2%27%20stroke-linejoin%3D%27round%27%2F%3E%3Ccircle%20cx%3D%2723%27%20cy%3D%2723%27%20r%3D%272.5%27%20fill%3D%27%2334d399%27%2F%3E%3C%2Fsvg%3E">
|
|
15
|
+
<title>AlphaSift · Local Quantitative Workbench</title>
|
|
16
|
+
<style>
|
|
17
|
+
:root {
|
|
18
|
+
--bg: #09090b;
|
|
19
|
+
--surface: #111115;
|
|
20
|
+
--surface-2: #17171d;
|
|
21
|
+
--ink: #f4f4f5;
|
|
22
|
+
--muted: #8e8e9a;
|
|
23
|
+
--border: rgba(255, 255, 255, 0.085);
|
|
24
|
+
--accent: #3b82f6;
|
|
25
|
+
--accent-hi: #60a5fa;
|
|
26
|
+
--emerald: #10b981;
|
|
27
|
+
--amber: #fbbf24;
|
|
28
|
+
--rose: #f43f5e;
|
|
29
|
+
--status-ok: #38bdf8;
|
|
30
|
+
--up: #f87171;
|
|
31
|
+
--down: #34d399;
|
|
32
|
+
--mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Monaco, Consolas, monospace;
|
|
33
|
+
--sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
34
|
+
}
|
|
35
|
+
html[data-theme="light"] {
|
|
36
|
+
--bg: #fafafa;
|
|
37
|
+
--surface: #ffffff;
|
|
38
|
+
--surface-2: #f4f4f5;
|
|
39
|
+
--ink: #09090b;
|
|
40
|
+
--muted: #52525b;
|
|
41
|
+
--border: rgba(9, 9, 11, 0.1);
|
|
42
|
+
--accent: #1d4ed8;
|
|
43
|
+
--accent-hi: #2563eb;
|
|
44
|
+
--emerald: #059669;
|
|
45
|
+
--amber: #b45309;
|
|
46
|
+
--rose: #e11d48;
|
|
47
|
+
--status-ok: #0284c7;
|
|
48
|
+
--up: #dc2626;
|
|
49
|
+
--down: #059669;
|
|
50
|
+
}
|
|
51
|
+
* { box-sizing: border-box; }
|
|
52
|
+
body {
|
|
53
|
+
margin: 0;
|
|
54
|
+
background: var(--bg);
|
|
55
|
+
color: var(--ink);
|
|
56
|
+
font-family: var(--sans);
|
|
57
|
+
line-height: 1.5;
|
|
58
|
+
-webkit-font-smoothing: antialiased;
|
|
59
|
+
}
|
|
60
|
+
.wrap { max-width: 1260px; margin: 0 auto; padding: 20px 18px 48px; }
|
|
61
|
+
header {
|
|
62
|
+
display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
|
|
63
|
+
gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
|
|
64
|
+
}
|
|
65
|
+
.brand { display: flex; align-items: center; gap: 10px; }
|
|
66
|
+
.brand-mark {
|
|
67
|
+
width: 34px; height: 34px; border-radius: 9px;
|
|
68
|
+
background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-hi);
|
|
69
|
+
display: grid; place-items: center; font-weight: 800; font-family: var(--mono);
|
|
70
|
+
}
|
|
71
|
+
.brand h1 { font-size: 18px; margin: 0; letter-spacing: -0.02em; }
|
|
72
|
+
.brand p { font-size: 12px; margin: 2px 0 0; color: var(--muted); }
|
|
73
|
+
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
74
|
+
button, select, input {
|
|
75
|
+
font-family: inherit; color: var(--ink); background: var(--surface);
|
|
76
|
+
border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; font-size: 13px;
|
|
77
|
+
}
|
|
78
|
+
a.ctrl-link {
|
|
79
|
+
text-decoration: none; font-family: inherit; color: var(--ink); background: var(--surface);
|
|
80
|
+
border: 1px solid var(--border); border-radius: 8px; padding: 6px 11px; font-size: 13px;
|
|
81
|
+
font-weight: 600; transition: border-color .15s, background .15s;
|
|
82
|
+
}
|
|
83
|
+
a.ctrl-link:hover { border-color: var(--accent-hi); }
|
|
84
|
+
button { cursor: pointer; font-weight: 600; transition: border-color .15s, background .15s; }
|
|
85
|
+
button:hover { border-color: var(--accent-hi); }
|
|
86
|
+
button.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
|
|
87
|
+
button.mini-btn { padding: 3px 8px; font-size: 11.5px; }
|
|
88
|
+
.card-head-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
|
|
89
|
+
.card-head-row .section-title { margin: 0; }
|
|
90
|
+
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
|
|
91
|
+
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
|
|
92
|
+
.card {
|
|
93
|
+
background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
|
|
94
|
+
}
|
|
95
|
+
.kpi-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
|
|
96
|
+
.kpi-val { font-size: 24px; font-weight: 700; font-family: var(--mono); margin-top: 4px; font-variant-numeric: tabular-nums; }
|
|
97
|
+
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
|
|
98
|
+
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 16px; }
|
|
99
|
+
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
|
|
100
|
+
.toolbar input { flex: 1; min-width: 200px; }
|
|
101
|
+
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
|
|
102
|
+
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
|
|
103
|
+
th, td { padding: 8px 11px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
|
|
104
|
+
th { font-size: 11px; color: var(--muted); text-transform: uppercase; background: var(--surface-2); letter-spacing: 0.03em; }
|
|
105
|
+
td.mono, th.mono { font-family: var(--mono); }
|
|
106
|
+
.badge {
|
|
107
|
+
display: inline-block; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
|
|
108
|
+
background: var(--surface-2); border: 1px solid var(--border); margin-right: 4px;
|
|
109
|
+
}
|
|
110
|
+
.badge.ok { color: var(--status-ok); border-color: rgba(56,189,248,0.4); }
|
|
111
|
+
.badge.warn { color: var(--amber); border-color: rgba(251,191,36,0.45); }
|
|
112
|
+
.badge.bad { color: var(--rose); border-color: rgba(244,63,94,0.45); }
|
|
113
|
+
.badge.accent { color: var(--accent-hi); border-color: rgba(96,165,250,0.45); }
|
|
114
|
+
.card.bad { border-color: rgba(244,63,94,0.5); }
|
|
115
|
+
.hidden { display: none; }
|
|
116
|
+
pre {
|
|
117
|
+
background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
|
|
118
|
+
padding: 12px; font-family: var(--mono); font-size: 12px; overflow-x: auto; margin: 8px 0 0;
|
|
119
|
+
}
|
|
120
|
+
.section-title { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
|
|
121
|
+
.empty { color: var(--muted); font-size: 13px; padding: 14px 0; }
|
|
122
|
+
a.ep-link {
|
|
123
|
+
display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 6px;
|
|
124
|
+
text-decoration: none; color: var(--accent-hi); font-family: var(--mono); font-size: 12px; margin: 4px 6px 4px 0;
|
|
125
|
+
background: var(--surface);
|
|
126
|
+
}
|
|
127
|
+
a.ep-link:hover { border-color: var(--accent-hi); }
|
|
128
|
+
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-top: 12px; }
|
|
129
|
+
.kline { width: 92px; height: 26px; display: inline-block; vertical-align: middle; }
|
|
130
|
+
details.raw-toggle { margin-top: 10px; font-size: 12px; color: var(--muted); }
|
|
131
|
+
details.raw-toggle summary { cursor: pointer; font-weight: 600; }
|
|
132
|
+
.chg-up { color: var(--up); } .chg-down { color: var(--down); }
|
|
133
|
+
</style>
|
|
134
|
+
</head>
|
|
135
|
+
<body>
|
|
136
|
+
<div class="wrap">
|
|
137
|
+
<header>
|
|
138
|
+
<div class="brand">
|
|
139
|
+
<div class="brand-mark">AS</div>
|
|
140
|
+
<div>
|
|
141
|
+
<h1 id="wb-title">AlphaSift Workbench</h1>
|
|
142
|
+
<p id="wb-sub">Read-only local UI backed by JSON API + YAML strategy catalog</p>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
<div class="controls">
|
|
146
|
+
<a class="ctrl-link" id="btn-daily-report" href="/daily-report.html" target="_blank" rel="noopener noreferrer">Daily Report</a>
|
|
147
|
+
<button type="button" id="btn-refresh">Refresh</button>
|
|
148
|
+
<button type="button" id="btn-lang">EN / 中文</button>
|
|
149
|
+
<button type="button" id="btn-theme">Light / Dark</button>
|
|
150
|
+
</div>
|
|
151
|
+
</header>
|
|
152
|
+
|
|
153
|
+
<nav class="tabs" id="tab-bar"></nav>
|
|
154
|
+
|
|
155
|
+
<section id="panel-overview"></section>
|
|
156
|
+
<section id="panel-strategies" class="hidden"></section>
|
|
157
|
+
<section id="panel-patterns" class="hidden"></section>
|
|
158
|
+
<section id="panel-runs" class="hidden"></section>
|
|
159
|
+
<section id="panel-mcp" class="hidden"></section>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<script>
|
|
163
|
+
(function () {
|
|
164
|
+
"use strict";
|
|
165
|
+
|
|
166
|
+
const SVG_NS = ["http", "://www.w3.org/2000/svg"].join("");
|
|
167
|
+
|
|
168
|
+
const TEXT = {
|
|
169
|
+
en: {
|
|
170
|
+
title: "AlphaSift · Local Quantitative Workbench",
|
|
171
|
+
sub: "Zero-dependency local UI for strategies, live pattern scans, saved runs & AI readiness",
|
|
172
|
+
btn_report: "Daily Report",
|
|
173
|
+
refresh: "Refresh",
|
|
174
|
+
tabs: { overview: "Overview", strategies: "Strategies", patterns: "Patterns", runs: "Runs & Picks", mcp: "MCP & API" },
|
|
175
|
+
kpi_strats: "Built-in Strategies",
|
|
176
|
+
kpi_pats: "Pattern Catalog",
|
|
177
|
+
kpi_runs: "Saved Runs",
|
|
178
|
+
kpi_health: "Doctor Radar",
|
|
179
|
+
doc_sources: "Data Source Readiness (Offline Check)",
|
|
180
|
+
radar_status: "Radar & Notification Config",
|
|
181
|
+
filter_ph: "Search name, market, category, or tag...",
|
|
182
|
+
all_mkts: "All Markets",
|
|
183
|
+
compare_title: "Compare Two Strategies",
|
|
184
|
+
run_compare: "Compare",
|
|
185
|
+
select_run: "Select Saved Run",
|
|
186
|
+
no_runs: "No saved runs found yet. Run `alphasift screen <strategy> --save-run` first.",
|
|
187
|
+
exposure_title: "Portfolio Topic Exposure & Replacement Candidates",
|
|
188
|
+
picks_title: "Top Picks & Topic Alignment",
|
|
189
|
+
mcp_title: "STDIO MCP Client Configuration (Claude Code / Cursor / OpenClaw)",
|
|
190
|
+
codex_title: "Codex CLI Quick Add",
|
|
191
|
+
copy_cli: "Copy CLI",
|
|
192
|
+
copy_json: "Copy JSON",
|
|
193
|
+
copy_cmd: "Copy",
|
|
194
|
+
copied_lbl: "Copied",
|
|
195
|
+
api_title: "Read-Only JSON Endpoints",
|
|
196
|
+
loading: "Loading local workbench telemetry...",
|
|
197
|
+
err_prefix: "Request failed: ",
|
|
198
|
+
cols_strat: ["Name", "Markets", "Category", "Version", "Horizon", "Daily Required", "Tags", "CLI"],
|
|
199
|
+
cols_pat: ["Pattern", "Markets", "Family", "Min History", "Status"],
|
|
200
|
+
cols_pick: ["#", "Stock", "Industry", "Score", "Topic Alignment", "Risk"],
|
|
201
|
+
cols_fresh: ["Family", "State", "Cache", "Notes"],
|
|
202
|
+
raw_json: "Raw JSON",
|
|
203
|
+
cmp_summary: "Differences Summary",
|
|
204
|
+
cmp_dim: "Dimension",
|
|
205
|
+
cmp_details: "Diff Detail",
|
|
206
|
+
scan_btn: "Scan Local Pack",
|
|
207
|
+
scan_running: "Scanning CN DailyPack...",
|
|
208
|
+
scan_need_pack: "CN DailyPack not found locally. Build it with: alphasift pack build --days 250",
|
|
209
|
+
scan_title: "Latest Local Pattern Scan",
|
|
210
|
+
scan_cols: ["Security", "Chg%", "Overhead", "20D K-Line"],
|
|
211
|
+
pf_all: "All",
|
|
212
|
+
pf_active: "active",
|
|
213
|
+
pf_exp: "experimental",
|
|
214
|
+
yes_lbl: "YES",
|
|
215
|
+
no_lbl: "NO",
|
|
216
|
+
radar_llm: "LLM Track",
|
|
217
|
+
radar_notify: "IM Notify",
|
|
218
|
+
radar_pack: "CN DailyPack",
|
|
219
|
+
radar_parity: "Pattern Parity",
|
|
220
|
+
},
|
|
221
|
+
zh: {
|
|
222
|
+
title: "AlphaSift · 本地量化工作台",
|
|
223
|
+
sub: "零外部依赖本地 Web UI — 策略对比、本地形态扫描、历史归因与就绪自检",
|
|
224
|
+
btn_report: "盘后日报",
|
|
225
|
+
refresh: "刷新数据",
|
|
226
|
+
tabs: { overview: "总览与自检", strategies: "内置策略", patterns: "形态扫描", runs: "历史运行与持仓暴露", mcp: "MCP 与 API" },
|
|
227
|
+
kpi_strats: "内置 YAML 策略",
|
|
228
|
+
kpi_pats: "形态模板",
|
|
229
|
+
kpi_runs: "已保存运行",
|
|
230
|
+
kpi_health: "系统就绪度",
|
|
231
|
+
doc_sources: "数据源健康与新鲜度检查",
|
|
232
|
+
radar_status: "模型与推送就绪状态",
|
|
233
|
+
filter_ph: "搜索策略名、市场、分类或标签…",
|
|
234
|
+
all_mkts: "全部市场",
|
|
235
|
+
compare_title: "双策略结构化对比",
|
|
236
|
+
run_compare: "对比",
|
|
237
|
+
select_run: "选择已保存运行",
|
|
238
|
+
no_runs: "暂无保存的选股记录,可先运行 `alphasift screen <strategy> --save-run`。",
|
|
239
|
+
exposure_title: "组合主题暴露、集中度预警与替补候选",
|
|
240
|
+
picks_title: "入选标的与热点对齐明细",
|
|
241
|
+
mcp_title: "STDIO MCP 客户端配置 (Claude Code / Cursor / OpenClaw)",
|
|
242
|
+
codex_title: "Codex CLI 一键接入",
|
|
243
|
+
copy_cli: "复制命令",
|
|
244
|
+
copy_json: "复制 JSON",
|
|
245
|
+
copy_cmd: "复制",
|
|
246
|
+
copied_lbl: "已复制",
|
|
247
|
+
api_title: "本地只读 JSON 接口索引",
|
|
248
|
+
loading: "正在读取本地量化服务数据…",
|
|
249
|
+
err_prefix: "请求失败:",
|
|
250
|
+
cols_strat: ["策略名", "适用市场", "类型", "版本", "周期", "需日 K", "标签", "快捷命令"],
|
|
251
|
+
cols_pat: ["形态名称", "市场", "谱系", "最少历史", "状态"],
|
|
252
|
+
cols_pick: ["#", "标的", "行业", "综合分", "热点对齐", "风险"],
|
|
253
|
+
cols_fresh: ["数据链路", "状态", "缓存状态", "建议"],
|
|
254
|
+
raw_json: "查看原始 JSON",
|
|
255
|
+
cmp_summary: "差异摘要",
|
|
256
|
+
cmp_dim: "对比维度",
|
|
257
|
+
cmp_details: "差异详情",
|
|
258
|
+
scan_btn: "扫描本地日线包",
|
|
259
|
+
scan_running: "正在扫描 CN 日线包…",
|
|
260
|
+
scan_need_pack: "本机尚未构建 A 股日线包,可先执行:alphasift pack build --days 250",
|
|
261
|
+
scan_title: "本地日线包形态扫描结果",
|
|
262
|
+
scan_cols: ["股票", "涨跌%", "上方筹码", "20日K线"],
|
|
263
|
+
pf_all: "全部",
|
|
264
|
+
pf_active: "active",
|
|
265
|
+
pf_exp: "experimental",
|
|
266
|
+
yes_lbl: "是",
|
|
267
|
+
no_lbl: "否",
|
|
268
|
+
radar_llm: "AI 复核",
|
|
269
|
+
radar_notify: "消息推送",
|
|
270
|
+
radar_pack: "A 股日线包",
|
|
271
|
+
radar_parity: "形态镜像同步",
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
function initialLang() {
|
|
276
|
+
const qp = new URLSearchParams(window.location.search).get("lang");
|
|
277
|
+
if (qp === "en" || qp === "zh") return qp;
|
|
278
|
+
try {
|
|
279
|
+
const saved = window.localStorage.getItem("alphasift_wb_lang");
|
|
280
|
+
if (saved === "en" || saved === "zh") return saved;
|
|
281
|
+
} catch (_) {}
|
|
282
|
+
return "en";
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function initialTheme() {
|
|
286
|
+
const qp = new URLSearchParams(window.location.search).get("theme");
|
|
287
|
+
if (qp === "dark" || qp === "light") return qp;
|
|
288
|
+
try {
|
|
289
|
+
const saved = window.localStorage.getItem("alphasift_wb_theme");
|
|
290
|
+
if (saved === "dark" || saved === "light") return saved;
|
|
291
|
+
} catch (_) {}
|
|
292
|
+
return "dark";
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
const state = {
|
|
296
|
+
lang: initialLang(),
|
|
297
|
+
theme: initialTheme(),
|
|
298
|
+
tab: "overview",
|
|
299
|
+
overview: null,
|
|
300
|
+
strategies: [],
|
|
301
|
+
patterns: [],
|
|
302
|
+
patFilter: "all",
|
|
303
|
+
patternScan: null,
|
|
304
|
+
patternScanErr: "",
|
|
305
|
+
patternScanning: false,
|
|
306
|
+
runs: [],
|
|
307
|
+
radar: null,
|
|
308
|
+
sources: null,
|
|
309
|
+
index: null,
|
|
310
|
+
selectedRunId: "",
|
|
311
|
+
activeRun: null,
|
|
312
|
+
compareResult: null,
|
|
313
|
+
runReqId: 0,
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
function t(key) {
|
|
317
|
+
return (TEXT[state.lang] && TEXT[state.lang][key]) || TEXT.en[key] || key;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function el(tag, attrs, children) {
|
|
321
|
+
const node = document.createElement(tag);
|
|
322
|
+
if (attrs) {
|
|
323
|
+
for (const [k, v] of Object.entries(attrs)) {
|
|
324
|
+
if (k === "class") node.className = v;
|
|
325
|
+
else if (k === "text") node.textContent = String(v);
|
|
326
|
+
else node.setAttribute(k, String(v));
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if (children) {
|
|
330
|
+
for (const child of Array.isArray(children) ? children : [children]) {
|
|
331
|
+
if (child === null || child === undefined) continue;
|
|
332
|
+
node.appendChild(typeof child === "string" ? document.createTextNode(child) : child);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return node;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function clear(node) {
|
|
339
|
+
while (node.firstChild) node.removeChild(node.firstChild);
|
|
340
|
+
return node;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function syncUrl() {
|
|
344
|
+
try {
|
|
345
|
+
const url = new URL(window.location.href);
|
|
346
|
+
url.searchParams.set("lang", state.lang);
|
|
347
|
+
url.searchParams.set("theme", state.theme);
|
|
348
|
+
window.history.replaceState(null, "", url.toString());
|
|
349
|
+
} catch (_) {}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function applyTheme() {
|
|
353
|
+
document.documentElement.setAttribute("data-theme", state.theme);
|
|
354
|
+
try { window.localStorage.setItem("alphasift_wb_theme", state.theme); } catch (_) {}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
async function fetchJson(path) {
|
|
358
|
+
const res = await fetch(path, { headers: { Accept: "application/json" }, cache: "no-store" });
|
|
359
|
+
if (!res.ok) {
|
|
360
|
+
let msg = res.status + " " + path;
|
|
361
|
+
try {
|
|
362
|
+
const errObj = await res.json();
|
|
363
|
+
if (errObj && errObj.error) msg = errObj.error + ": " + (errObj.message || msg);
|
|
364
|
+
} catch (_) {}
|
|
365
|
+
throw new Error(msg);
|
|
366
|
+
}
|
|
367
|
+
return await res.json();
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function makeBadge(label, tone) {
|
|
371
|
+
return el("span", { class: "badge" + (tone ? " " + tone : ""), text: label });
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function copyText(text, btn, origLabel) {
|
|
375
|
+
const markDone = () => {
|
|
376
|
+
if (!btn) return;
|
|
377
|
+
if (btn._copyTimer) clearTimeout(btn._copyTimer);
|
|
378
|
+
btn.textContent = t("copied_lbl");
|
|
379
|
+
btn._copyTimer = setTimeout(() => { btn.textContent = origLabel; }, 1500);
|
|
380
|
+
};
|
|
381
|
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
382
|
+
navigator.clipboard.writeText(text).then(markDone).catch(() => {
|
|
383
|
+
fallbackCopy(text, markDone);
|
|
384
|
+
});
|
|
385
|
+
} else {
|
|
386
|
+
fallbackCopy(text, markDone);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function fallbackCopy(text, onDone) {
|
|
391
|
+
try {
|
|
392
|
+
const ta = document.createElement("textarea");
|
|
393
|
+
ta.value = text;
|
|
394
|
+
ta.setAttribute("readonly", "");
|
|
395
|
+
ta.style.position = "fixed";
|
|
396
|
+
ta.style.opacity = "0";
|
|
397
|
+
document.body.appendChild(ta);
|
|
398
|
+
ta.select();
|
|
399
|
+
document.execCommand("copy");
|
|
400
|
+
document.body.removeChild(ta);
|
|
401
|
+
onDone();
|
|
402
|
+
} catch (_) {}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function makeSvgKline(bars) {
|
|
406
|
+
if (!Array.isArray(bars) || !bars.length) return el("span", { class: "kpi-sub", text: "-" });
|
|
407
|
+
let lo = Infinity, hi = -Infinity;
|
|
408
|
+
for (const b of bars) {
|
|
409
|
+
if (!Array.isArray(b) || b.length < 4) continue;
|
|
410
|
+
if (b[2] < lo) lo = b[2];
|
|
411
|
+
if (b[1] > hi) hi = b[1];
|
|
412
|
+
}
|
|
413
|
+
if (!Number.isFinite(lo) || !Number.isFinite(hi)) return el("span", { text: "-" });
|
|
414
|
+
const span = Math.max(hi - lo, hi * 0.005, 1e-6);
|
|
415
|
+
const W = 92, H = 26, pad = 2;
|
|
416
|
+
const step = (W - pad * 2) / bars.length;
|
|
417
|
+
const bw = Math.max(1.6, step * 0.65);
|
|
418
|
+
const yFn = (p) => pad + (1 - (p - lo) / span) * (H - pad * 2);
|
|
419
|
+
const svg = document.createElementNS(SVG_NS, "svg");
|
|
420
|
+
svg.setAttribute("class", "kline");
|
|
421
|
+
svg.setAttribute("viewBox", "0 0 " + W + " " + H);
|
|
422
|
+
bars.forEach((b, i) => {
|
|
423
|
+
const [o, h, l, c] = b;
|
|
424
|
+
const cx = (pad + (i + 0.5) * step).toFixed(1);
|
|
425
|
+
const col = c >= o ? "var(--up)" : "var(--down)";
|
|
426
|
+
const yTop = yFn(Math.max(o, c));
|
|
427
|
+
const yBot = yFn(Math.min(o, c));
|
|
428
|
+
const line = document.createElementNS(SVG_NS, "line");
|
|
429
|
+
line.setAttribute("x1", cx);
|
|
430
|
+
line.setAttribute("x2", cx);
|
|
431
|
+
line.setAttribute("y1", yFn(h).toFixed(1));
|
|
432
|
+
line.setAttribute("y2", yFn(l).toFixed(1));
|
|
433
|
+
line.setAttribute("stroke", col);
|
|
434
|
+
line.setAttribute("stroke-width", "1");
|
|
435
|
+
const rect = document.createElementNS(SVG_NS, "rect");
|
|
436
|
+
rect.setAttribute("x", (Number(cx) - bw / 2).toFixed(1));
|
|
437
|
+
rect.setAttribute("y", yTop.toFixed(1));
|
|
438
|
+
rect.setAttribute("width", bw.toFixed(1));
|
|
439
|
+
rect.setAttribute("height", Math.max(1.4, yBot - yTop).toFixed(1));
|
|
440
|
+
rect.setAttribute("fill", col);
|
|
441
|
+
svg.appendChild(line);
|
|
442
|
+
svg.appendChild(rect);
|
|
443
|
+
});
|
|
444
|
+
return svg;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function renderHeaderAndTabs() {
|
|
448
|
+
document.getElementById("wb-title").textContent = t("title");
|
|
449
|
+
document.getElementById("wb-sub").textContent = t("sub");
|
|
450
|
+
const repLink = document.getElementById("btn-daily-report");
|
|
451
|
+
if (repLink) repLink.textContent = t("btn_report");
|
|
452
|
+
document.getElementById("btn-refresh").textContent = t("refresh");
|
|
453
|
+
const tabLabels = t("tabs");
|
|
454
|
+
const bar = clear(document.getElementById("tab-bar"));
|
|
455
|
+
for (const id of ["overview", "strategies", "patterns", "runs", "mcp"]) {
|
|
456
|
+
const btn = el("button", { type: "button", class: state.tab === id ? "active" : "", text: tabLabels[id] });
|
|
457
|
+
btn.addEventListener("click", function () {
|
|
458
|
+
state.tab = id;
|
|
459
|
+
renderAll();
|
|
460
|
+
});
|
|
461
|
+
bar.appendChild(btn);
|
|
462
|
+
}
|
|
463
|
+
for (const id of ["overview", "strategies", "patterns", "runs", "mcp"]) {
|
|
464
|
+
const sec = document.getElementById("panel-" + id);
|
|
465
|
+
if (state.tab === id) sec.classList.remove("hidden");
|
|
466
|
+
else sec.classList.add("hidden");
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function stratMarkets(s) {
|
|
471
|
+
return Array.isArray(s && s.market_scope) && s.market_scope.length ? s.market_scope : ["cn"];
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function renderOverview() {
|
|
475
|
+
const root = clear(document.getElementById("panel-overview"));
|
|
476
|
+
const ov = state.overview || {};
|
|
477
|
+
const ovSum = ov.summary || {};
|
|
478
|
+
const radar = state.radar || {};
|
|
479
|
+
const radPat = radar.patterns || {};
|
|
480
|
+
const radLlm = radar.llm || {};
|
|
481
|
+
const radPack = radar.pack || {};
|
|
482
|
+
const radNotify = radar.notify || {};
|
|
483
|
+
const src = state.sources || {};
|
|
484
|
+
|
|
485
|
+
const mkts = Array.from(new Set(state.strategies.flatMap((s) => stratMarkets(s))));
|
|
486
|
+
const kpiGrid = el("div", { class: "kpi-grid" }, [
|
|
487
|
+
el("div", { class: "card" }, [
|
|
488
|
+
el("div", { class: "kpi-label", text: t("kpi_strats") }),
|
|
489
|
+
el("div", { class: "kpi-val", text: String(state.strategies.length || ovSum.strategy_count || 0) }),
|
|
490
|
+
el("div", { class: "kpi-sub", text: (mkts.length ? mkts : ["cn","hk","us","jp","kr","tw","in"]).join(", ").toUpperCase() }),
|
|
491
|
+
]),
|
|
492
|
+
el("div", { class: "card" }, [
|
|
493
|
+
el("div", { class: "kpi-label", text: t("kpi_pats") }),
|
|
494
|
+
el("div", { class: "kpi-val", text: String(state.patterns.length || radPat.total || 0) }),
|
|
495
|
+
el("div", {
|
|
496
|
+
class: "kpi-sub",
|
|
497
|
+
text: radPat.total !== undefined
|
|
498
|
+
? String(radPat.active_count || 0) + " active · " + String(radPat.experimental_count || 0) + " experimental"
|
|
499
|
+
: "250-day next_open verified",
|
|
500
|
+
}),
|
|
501
|
+
]),
|
|
502
|
+
el("div", { class: "card" }, [
|
|
503
|
+
el("div", { class: "kpi-label", text: t("kpi_runs") }),
|
|
504
|
+
el("div", { class: "kpi-val", text: String(state.runs.length || ovSum.recent_run_count || 0) }),
|
|
505
|
+
el("div", { class: "kpi-sub", text: state.runs[0] ? String(state.runs[0].run_id || "") : "-" }),
|
|
506
|
+
]),
|
|
507
|
+
el("div", { class: "card" }, [
|
|
508
|
+
el("div", { class: "kpi-label", text: t("kpi_health") }),
|
|
509
|
+
el("div", { class: "kpi-val", text: String(radar.status || src.status || "ok").toUpperCase() }),
|
|
510
|
+
el("div", { class: "kpi-sub", text: "LLM: " + (radLlm.configured ? String(radLlm.ai_track_mode || "configured") : "rules-only") }),
|
|
511
|
+
]),
|
|
512
|
+
]);
|
|
513
|
+
root.appendChild(kpiGrid);
|
|
514
|
+
|
|
515
|
+
const row = el("div", { class: "row" });
|
|
516
|
+
const radarCard = el("div", { class: "card" }, [el("h3", { class: "section-title", text: t("radar_status") })]);
|
|
517
|
+
const radarItems = [
|
|
518
|
+
{
|
|
519
|
+
label: t("radar_llm"),
|
|
520
|
+
tone: radLlm.configured ? "ok" : "warn",
|
|
521
|
+
badge: radLlm.configured ? "CONFIGURED" : "RULES",
|
|
522
|
+
detail: String(radLlm.ai_track_mode || "rules_only"),
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
label: t("radar_notify"),
|
|
526
|
+
tone: radNotify.any_configured ? "ok" : "warn",
|
|
527
|
+
badge: radNotify.any_configured ? "READY" : "NONE",
|
|
528
|
+
detail: (radNotify.configured_channels || []).length
|
|
529
|
+
? (radNotify.configured_channels || []).join(", ")
|
|
530
|
+
: "0 targets",
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
label: t("radar_pack"),
|
|
534
|
+
tone: radPack.valid && radPack.fresh ? "ok" : radPack.exists ? "warn" : "bad",
|
|
535
|
+
badge: radPack.valid ? (radPack.fresh ? "FRESH" : "STALE") : "ABSENT",
|
|
536
|
+
detail: (radPack.trade_date || "-") + " / " + (radPack.expected_trade_date || "-"),
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
label: t("radar_parity"),
|
|
540
|
+
tone: radPat.mirror_sync_ok ? "ok" : "bad",
|
|
541
|
+
badge: radPat.mirror_sync_ok ? "SYNCED" : "DRIFT",
|
|
542
|
+
detail: String(radPat.active_count || 0) + " active / " + String(radPat.experimental_count || 0) + " exp",
|
|
543
|
+
},
|
|
544
|
+
];
|
|
545
|
+
const list = el("div");
|
|
546
|
+
for (const item of radarItems) {
|
|
547
|
+
list.appendChild(el("div", { style: "margin:6px 0;" }, [
|
|
548
|
+
makeBadge(item.badge, item.tone),
|
|
549
|
+
el("span", { text: item.label + " — " + item.detail }),
|
|
550
|
+
]));
|
|
551
|
+
}
|
|
552
|
+
if (Array.isArray(radar.recommendations) && radar.recommendations.length) {
|
|
553
|
+
const recBox = el("div", { style: "margin-top:8px;" });
|
|
554
|
+
for (const r of radar.recommendations) {
|
|
555
|
+
recBox.appendChild(el("div", { class: "kpi-sub", text: "• " + String(r) }));
|
|
556
|
+
}
|
|
557
|
+
list.appendChild(recBox);
|
|
558
|
+
}
|
|
559
|
+
radarCard.appendChild(list);
|
|
560
|
+
|
|
561
|
+
const srcCard = el("div", { class: "card" }, [el("h3", { class: "section-title", text: t("doc_sources") })]);
|
|
562
|
+
const srcOrder = (src.config && src.config.snapshot_source_priority) || [];
|
|
563
|
+
if (Array.isArray(srcOrder) && srcOrder.length) {
|
|
564
|
+
const box = el("div", { style: "margin-bottom:10px;" });
|
|
565
|
+
for (const name of srcOrder) box.appendChild(makeBadge(String(name), "accent"));
|
|
566
|
+
srcCard.appendChild(box);
|
|
567
|
+
}
|
|
568
|
+
const fresh = src.freshness_summary || {};
|
|
569
|
+
const freshCols = t("cols_fresh");
|
|
570
|
+
const tblWrap = el("div", { class: "table-wrap" });
|
|
571
|
+
const fTbl = el("table");
|
|
572
|
+
fTbl.appendChild(el("thead", null, el("tr", null, freshCols.map((c) => el("th", { text: c })))));
|
|
573
|
+
const fBody = el("tbody");
|
|
574
|
+
for (const famKey of ["snapshot", "daily"]) {
|
|
575
|
+
const f = fresh[famKey];
|
|
576
|
+
if (!f || typeof f !== "object") continue;
|
|
577
|
+
const st = String(f.data_state || "unknown");
|
|
578
|
+
const tone = st === "fresh" ? "ok" : st === "unavailable" ? "bad" : "warn";
|
|
579
|
+
fBody.appendChild(el("tr", null, [
|
|
580
|
+
el("td", { class: "mono", text: String(f.family || famKey) }),
|
|
581
|
+
el("td", null, makeBadge(st, tone)),
|
|
582
|
+
el("td", { class: "mono", text: String(f.cache_state || "-") }),
|
|
583
|
+
el("td", { class: "kpi-sub", text: String(f.recommendation || "-") }),
|
|
584
|
+
]));
|
|
585
|
+
}
|
|
586
|
+
fTbl.appendChild(fBody);
|
|
587
|
+
tblWrap.appendChild(fTbl);
|
|
588
|
+
srcCard.appendChild(tblWrap);
|
|
589
|
+
const rawFresh = el("details", { class: "raw-toggle" }, [
|
|
590
|
+
el("summary", { text: t("raw_json") }),
|
|
591
|
+
el("pre", { text: JSON.stringify(fresh, null, 2) }),
|
|
592
|
+
]);
|
|
593
|
+
srcCard.appendChild(rawFresh);
|
|
594
|
+
|
|
595
|
+
row.appendChild(radarCard);
|
|
596
|
+
row.appendChild(srcCard);
|
|
597
|
+
root.appendChild(row);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function renderCompareBody(container, data) {
|
|
601
|
+
clear(container);
|
|
602
|
+
if (!data) return;
|
|
603
|
+
if (typeof data === "string") {
|
|
604
|
+
container.appendChild(el("div", { class: "empty", text: data }));
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const notes = Array.isArray(data.summary) ? data.summary : [];
|
|
608
|
+
if (notes.length) {
|
|
609
|
+
const box = el("div", { style: "margin:8px 0;" });
|
|
610
|
+
box.appendChild(el("div", { class: "kpi-label", text: t("cmp_summary") }));
|
|
611
|
+
for (const n of notes) box.appendChild(el("div", { class: "kpi-sub", text: "• " + String(n) }));
|
|
612
|
+
container.appendChild(box);
|
|
613
|
+
}
|
|
614
|
+
const diffs = data.differences || {};
|
|
615
|
+
const wrap = el("div", { class: "table-wrap", style: "margin-top:8px;" });
|
|
616
|
+
const tbl = el("table");
|
|
617
|
+
tbl.appendChild(el("thead", null, el("tr", null, [
|
|
618
|
+
el("th", { text: t("cmp_dim") }),
|
|
619
|
+
el("th", { text: t("cmp_details") }),
|
|
620
|
+
])));
|
|
621
|
+
const tbody = el("tbody");
|
|
622
|
+
for (const [k, v] of Object.entries(diffs)) {
|
|
623
|
+
let summaryText = "-";
|
|
624
|
+
if (v && typeof v === "object") {
|
|
625
|
+
if ("changed" in v) summaryText = JSON.stringify(v.changed);
|
|
626
|
+
else if (Array.isArray(v.added) || Array.isArray(v.removed)) {
|
|
627
|
+
summaryText = "+" + JSON.stringify(v.added || []) + " / -" + JSON.stringify(v.removed || []);
|
|
628
|
+
} else {
|
|
629
|
+
summaryText = JSON.stringify(v);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
tbody.appendChild(el("tr", null, [
|
|
633
|
+
el("td", { class: "mono", text: k }),
|
|
634
|
+
el("td", { class: "kpi-sub mono", text: summaryText }),
|
|
635
|
+
]));
|
|
636
|
+
}
|
|
637
|
+
tbl.appendChild(tbody);
|
|
638
|
+
wrap.appendChild(tbl);
|
|
639
|
+
container.appendChild(wrap);
|
|
640
|
+
container.appendChild(el("details", { class: "raw-toggle" }, [
|
|
641
|
+
el("summary", { text: t("raw_json") }),
|
|
642
|
+
el("pre", { text: JSON.stringify(data, null, 2) }),
|
|
643
|
+
]));
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
function renderStrategies() {
|
|
647
|
+
const root = clear(document.getElementById("panel-strategies"));
|
|
648
|
+
const bar = el("div", { class: "toolbar" });
|
|
649
|
+
const search = el("input", { type: "search", placeholder: t("filter_ph") });
|
|
650
|
+
const mktSel = el("select");
|
|
651
|
+
mktSel.appendChild(el("option", { value: "", text: t("all_mkts") }));
|
|
652
|
+
const allMkts = Array.from(new Set(state.strategies.flatMap((s) => stratMarkets(s)))).sort();
|
|
653
|
+
for (const m of allMkts) {
|
|
654
|
+
mktSel.appendChild(el("option", { value: m, text: m.toUpperCase() }));
|
|
655
|
+
}
|
|
656
|
+
bar.appendChild(search);
|
|
657
|
+
bar.appendChild(mktSel);
|
|
658
|
+
root.appendChild(bar);
|
|
659
|
+
|
|
660
|
+
const tblWrap = el("div", { class: "table-wrap" });
|
|
661
|
+
root.appendChild(tblWrap);
|
|
662
|
+
const sCols = t("cols_strat");
|
|
663
|
+
|
|
664
|
+
function drawTable() {
|
|
665
|
+
const q = search.value.trim().toLowerCase();
|
|
666
|
+
const mk = mktSel.value;
|
|
667
|
+
const filtered = state.strategies.filter((s) => {
|
|
668
|
+
const mkts = stratMarkets(s);
|
|
669
|
+
if (mk && !mkts.includes(mk)) return false;
|
|
670
|
+
if (!q) return true;
|
|
671
|
+
const hay = [s.name, s.display_name, mkts.join(" "), s.category, (s.tags || []).join(" ")].join(" ").toLowerCase();
|
|
672
|
+
return hay.includes(q);
|
|
673
|
+
});
|
|
674
|
+
const table = el("table");
|
|
675
|
+
const thead = el("thead", null, el("tr", null, sCols.map((c) => el("th", { text: c }))));
|
|
676
|
+
const tbody = el("tbody");
|
|
677
|
+
for (const s of filtered) {
|
|
678
|
+
const mkts = stratMarkets(s);
|
|
679
|
+
const holding = (s.style && s.style.holding_period) || "-";
|
|
680
|
+
const cliCmd = "alphasift screen " + String(s.name || "") + " --market " + String(mkts[0] || "cn") + " --no-llm --explain";
|
|
681
|
+
const cliBtn = el("button", { type: "button", class: "mini-btn", text: t("copy_cli"), title: cliCmd });
|
|
682
|
+
cliBtn.addEventListener("click", function () { copyText(cliCmd, cliBtn, t("copy_cli")); });
|
|
683
|
+
tbody.appendChild(el("tr", null, [
|
|
684
|
+
el("td", null, [el("strong", { text: s.display_name || s.name }), el("div", { class: "kpi-sub", text: s.name })]),
|
|
685
|
+
el("td", null, mkts.map((m) => makeBadge(String(m).toUpperCase(), "accent"))),
|
|
686
|
+
el("td", { text: String(s.category || "-") }),
|
|
687
|
+
el("td", { class: "mono", text: String(s.version || "-") }),
|
|
688
|
+
el("td", { class: "mono", text: String(holding) }),
|
|
689
|
+
el("td", null, makeBadge(s.requires_daily_features ? t("yes_lbl") : t("no_lbl"), s.requires_daily_features ? "warn" : "ok")),
|
|
690
|
+
el("td", null, (s.tags || []).slice(0, 4).map((tg) => makeBadge(String(tg)))),
|
|
691
|
+
el("td", null, cliBtn),
|
|
692
|
+
]));
|
|
693
|
+
}
|
|
694
|
+
table.appendChild(thead);
|
|
695
|
+
table.appendChild(tbody);
|
|
696
|
+
clear(tblWrap).appendChild(table);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
search.addEventListener("input", drawTable);
|
|
700
|
+
mktSel.addEventListener("change", drawTable);
|
|
701
|
+
drawTable();
|
|
702
|
+
|
|
703
|
+
if (state.strategies.length >= 2) {
|
|
704
|
+
const cmpCard = el("div", { class: "card", style: "margin-top:16px;" });
|
|
705
|
+
cmpCard.appendChild(el("h3", { class: "section-title", text: t("compare_title") }));
|
|
706
|
+
const selA = el("select");
|
|
707
|
+
const selB = el("select");
|
|
708
|
+
state.strategies.forEach((s, idx) => {
|
|
709
|
+
selA.appendChild(el("option", { value: s.name, text: s.name }));
|
|
710
|
+
const optB = el("option", { value: s.name, text: s.name });
|
|
711
|
+
if (idx === 1) optB.selected = true;
|
|
712
|
+
selB.appendChild(optB);
|
|
713
|
+
});
|
|
714
|
+
const btnCmp = el("button", { type: "button", text: t("run_compare") });
|
|
715
|
+
const cmpOut = el("div");
|
|
716
|
+
if (state.compareResult) renderCompareBody(cmpOut, state.compareResult);
|
|
717
|
+
btnCmp.addEventListener("click", async function () {
|
|
718
|
+
try {
|
|
719
|
+
const data = await fetchJson(
|
|
720
|
+
"/strategy-compare?base=" + encodeURIComponent(selA.value) + "&target=" + encodeURIComponent(selB.value)
|
|
721
|
+
);
|
|
722
|
+
state.compareResult = data;
|
|
723
|
+
renderCompareBody(cmpOut, data);
|
|
724
|
+
} catch (err) {
|
|
725
|
+
renderCompareBody(cmpOut, t("err_prefix") + err.message);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
cmpCard.appendChild(el("div", { class: "toolbar" }, [selA, selB, btnCmp]));
|
|
729
|
+
cmpCard.appendChild(cmpOut);
|
|
730
|
+
root.appendChild(cmpCard);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
async function runPatternScan() {
|
|
735
|
+
state.patternScanning = true;
|
|
736
|
+
state.patternScanErr = "";
|
|
737
|
+
renderPatterns();
|
|
738
|
+
try {
|
|
739
|
+
state.patternScan = await fetchJson("/patterns/scan?include_experimental=true&with_kline=1");
|
|
740
|
+
} catch (err) {
|
|
741
|
+
state.patternScan = null;
|
|
742
|
+
state.patternScanErr = String(err.message || err);
|
|
743
|
+
} finally {
|
|
744
|
+
state.patternScanning = false;
|
|
745
|
+
renderPatterns();
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
function renderPatterns() {
|
|
750
|
+
const root = clear(document.getElementById("panel-patterns"));
|
|
751
|
+
const bar = el("div", { class: "toolbar" });
|
|
752
|
+
for (const pf of [
|
|
753
|
+
["all", t("pf_all")],
|
|
754
|
+
["active", t("pf_active")],
|
|
755
|
+
["experimental", t("pf_exp")],
|
|
756
|
+
]) {
|
|
757
|
+
const btn = el("button", { type: "button", class: state.patFilter === pf[0] ? "active" : "", text: pf[1] });
|
|
758
|
+
btn.addEventListener("click", function () {
|
|
759
|
+
state.patFilter = pf[0];
|
|
760
|
+
renderPatterns();
|
|
761
|
+
});
|
|
762
|
+
bar.appendChild(btn);
|
|
763
|
+
}
|
|
764
|
+
const scanBtn = el("button", {
|
|
765
|
+
type: "button",
|
|
766
|
+
id: "btn-scan-patterns",
|
|
767
|
+
text: state.patternScanning ? t("scan_running") : t("scan_btn"),
|
|
768
|
+
});
|
|
769
|
+
scanBtn.addEventListener("click", runPatternScan);
|
|
770
|
+
bar.appendChild(scanBtn);
|
|
771
|
+
root.appendChild(bar);
|
|
772
|
+
|
|
773
|
+
const pCols = t("cols_pat");
|
|
774
|
+
const tblWrap = el("div", { class: "table-wrap" });
|
|
775
|
+
const table = el("table");
|
|
776
|
+
table.appendChild(el("thead", null, el("tr", null, pCols.map((c) => el("th", { text: c })))));
|
|
777
|
+
const tbody = el("tbody");
|
|
778
|
+
const filteredPats = state.patterns.filter((p) => {
|
|
779
|
+
const st = String(p.status || "experimental");
|
|
780
|
+
return state.patFilter === "all" || st === state.patFilter;
|
|
781
|
+
});
|
|
782
|
+
for (const p of filteredPats) {
|
|
783
|
+
const statusText = String(p.status || "experimental");
|
|
784
|
+
const isActive = statusText === "active";
|
|
785
|
+
const mkts = Array.isArray(p.market_scope) && p.market_scope.length ? p.market_scope : ["cn"];
|
|
786
|
+
tbody.appendChild(el("tr", null, [
|
|
787
|
+
el("td", null, [el("strong", { text: p.display_name || p.name }), el("div", { class: "kpi-sub", text: p.name })]),
|
|
788
|
+
el("td", null, mkts.map((m) => makeBadge(String(m).toUpperCase(), "accent"))),
|
|
789
|
+
el("td", { text: String(p.family || "-") }),
|
|
790
|
+
el("td", { class: "mono", text: p.min_history_days ? p.min_history_days + "d" : "-" }),
|
|
791
|
+
el("td", null, makeBadge(statusText, isActive ? "ok" : "warn")),
|
|
792
|
+
]));
|
|
793
|
+
}
|
|
794
|
+
table.appendChild(tbody);
|
|
795
|
+
tblWrap.appendChild(table);
|
|
796
|
+
root.appendChild(tblWrap);
|
|
797
|
+
|
|
798
|
+
if (state.patternScanErr) {
|
|
799
|
+
const msg = state.patternScanErr.includes("pack_unavailable")
|
|
800
|
+
? t("scan_need_pack")
|
|
801
|
+
: t("err_prefix") + state.patternScanErr;
|
|
802
|
+
root.appendChild(el("div", { class: "card", style: "margin-top:14px;" }, el("div", { class: "empty", text: msg })));
|
|
803
|
+
} else if (state.patternScan) {
|
|
804
|
+
const sc = state.patternScan;
|
|
805
|
+
const sigMap = sc.signals_by_pattern || {};
|
|
806
|
+
const counts = sc.counts_by_pattern || {};
|
|
807
|
+
const scanCardWrap = el("div", { style: "margin-top:16px;" }, [
|
|
808
|
+
el("h3", { class: "section-title", text: t("scan_title") + " · " + String(sc.trade_date || "") }),
|
|
809
|
+
]);
|
|
810
|
+
const grid = el("div", { class: "cards" });
|
|
811
|
+
const sCols = t("scan_cols");
|
|
812
|
+
for (const pName of Object.keys(counts)) {
|
|
813
|
+
const items = sigMap[pName] || [];
|
|
814
|
+
const card = el("div", { class: "card" }, [
|
|
815
|
+
el("div", { style: "display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;" }, [
|
|
816
|
+
el("strong", { text: (items[0] && items[0].display_name) || pName }),
|
|
817
|
+
makeBadge(String(counts[pName] || 0), (counts[pName] || 0) > 0 ? "accent" : ""),
|
|
818
|
+
]),
|
|
819
|
+
]);
|
|
820
|
+
if (!items.length) {
|
|
821
|
+
card.appendChild(el("div", { class: "kpi-sub", text: "-" }));
|
|
822
|
+
} else {
|
|
823
|
+
const innerWrap = el("div", { class: "table-wrap" });
|
|
824
|
+
const stbl = el("table");
|
|
825
|
+
stbl.appendChild(el("thead", null, el("tr", null, sCols.map((c) => el("th", { text: c })))));
|
|
826
|
+
const sbody = el("tbody");
|
|
827
|
+
for (const it of items.slice(0, 6)) {
|
|
828
|
+
const chg = Number(it.change_pct || 0);
|
|
829
|
+
const ov = it.overhead_supply_10pct !== null && it.overhead_supply_10pct !== undefined
|
|
830
|
+
? Number(it.overhead_supply_10pct).toFixed(0) + "%"
|
|
831
|
+
: "-";
|
|
832
|
+
sbody.appendChild(el("tr", null, [
|
|
833
|
+
el("td", null, [el("strong", { text: it.name || it.code }), el("div", { class: "kpi-sub mono", text: it.code })]),
|
|
834
|
+
el("td", { class: "mono " + (chg >= 0 ? "chg-up" : "chg-down"), text: (chg > 0 ? "+" : "") + chg.toFixed(2) + "%" }),
|
|
835
|
+
el("td", { class: "mono", text: ov }),
|
|
836
|
+
el("td", null, makeSvgKline(it.kline)),
|
|
837
|
+
]));
|
|
838
|
+
}
|
|
839
|
+
stbl.appendChild(sbody);
|
|
840
|
+
innerWrap.appendChild(stbl);
|
|
841
|
+
card.appendChild(innerWrap);
|
|
842
|
+
}
|
|
843
|
+
grid.appendChild(card);
|
|
844
|
+
}
|
|
845
|
+
scanCardWrap.appendChild(grid);
|
|
846
|
+
root.appendChild(scanCardWrap);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
async function selectRun(runId) {
|
|
851
|
+
if (!runId) return;
|
|
852
|
+
state.selectedRunId = runId;
|
|
853
|
+
const reqId = ++state.runReqId;
|
|
854
|
+
try {
|
|
855
|
+
const data = await fetchJson("/report?run=" + encodeURIComponent(runId));
|
|
856
|
+
if (reqId !== state.runReqId) return;
|
|
857
|
+
state.activeRun = data;
|
|
858
|
+
renderRuns();
|
|
859
|
+
} catch (err) {
|
|
860
|
+
if (reqId !== state.runReqId) return;
|
|
861
|
+
state.activeRun = { error: err.message };
|
|
862
|
+
renderRuns();
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
function renderRuns() {
|
|
867
|
+
const root = clear(document.getElementById("panel-runs"));
|
|
868
|
+
if (!state.runs.length) {
|
|
869
|
+
root.appendChild(el("div", { class: "card empty", text: t("no_runs") }));
|
|
870
|
+
return;
|
|
871
|
+
}
|
|
872
|
+
const bar = el("div", { class: "toolbar" });
|
|
873
|
+
bar.appendChild(el("span", { class: "kpi-label", text: t("select_run") }));
|
|
874
|
+
const sel = el("select");
|
|
875
|
+
for (const r of state.runs) {
|
|
876
|
+
const rid = String(r.run_id || "");
|
|
877
|
+
const label = rid + " · " + String(r.strategy || "") + " (" + String(r.market || "").toUpperCase() + ")";
|
|
878
|
+
const opt = el("option", { value: rid, text: label });
|
|
879
|
+
if (state.selectedRunId === rid) opt.selected = true;
|
|
880
|
+
sel.appendChild(opt);
|
|
881
|
+
}
|
|
882
|
+
sel.addEventListener("change", function () { selectRun(sel.value); });
|
|
883
|
+
bar.appendChild(sel);
|
|
884
|
+
root.appendChild(bar);
|
|
885
|
+
|
|
886
|
+
if (!state.activeRun) {
|
|
887
|
+
selectRun(state.selectedRunId || String(state.runs[0].run_id || ""));
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
if (state.activeRun.error) {
|
|
891
|
+
root.appendChild(el("div", { class: "card bad", text: t("err_prefix") + state.activeRun.error }));
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
const rep = state.activeRun;
|
|
895
|
+
const sh = rep.source_health || {};
|
|
896
|
+
const expMap = sh.portfolio_topic_exposure || {};
|
|
897
|
+
const overList = sh.overconcentrated_topics || [];
|
|
898
|
+
const repList = sh.replacement_candidates || [];
|
|
899
|
+
|
|
900
|
+
const expCard = el("div", { class: "card", style: "margin-bottom:14px;" }, [
|
|
901
|
+
el("h3", { class: "section-title", text: t("exposure_title") }),
|
|
902
|
+
]);
|
|
903
|
+
const bucketEntries = Object.entries(expMap);
|
|
904
|
+
if (bucketEntries.length) {
|
|
905
|
+
const badges = el("div", { style: "margin-bottom:8px;" });
|
|
906
|
+
for (const [bName, info] of bucketEntries) {
|
|
907
|
+
const tone = info && info.overconcentrated ? "bad" : "accent";
|
|
908
|
+
badges.appendChild(makeBadge(bName + ": " + String(info.count || 0) + " (" + String(info.share_pct || 0) + "%)", tone));
|
|
909
|
+
}
|
|
910
|
+
expCard.appendChild(badges);
|
|
911
|
+
}
|
|
912
|
+
if (overList.length) {
|
|
913
|
+
expCard.appendChild(el("div", { style: "margin:6px 0;" }, [makeBadge("Overconcentrated: " + overList.join(", "), "bad")]));
|
|
914
|
+
}
|
|
915
|
+
if (repList.length) {
|
|
916
|
+
expCard.appendChild(el("div", { class: "kpi-sub", text: "Replacements: " + repList.map((c) => c.code + " " + c.name + " (" + c.bucket + ")").join(" · ") }));
|
|
917
|
+
}
|
|
918
|
+
root.appendChild(expCard);
|
|
919
|
+
|
|
920
|
+
const picks = rep.top_picks || [];
|
|
921
|
+
const picksCard = el("div", { class: "card" }, [el("h3", { class: "section-title", text: t("picks_title") })]);
|
|
922
|
+
const tblWrap = el("div", { class: "table-wrap" });
|
|
923
|
+
const table = el("table");
|
|
924
|
+
const pkCols = t("cols_pick");
|
|
925
|
+
table.appendChild(el("thead", null, el("tr", null, pkCols.map((c, idx) => el("th", { class: idx === 0 || idx === 3 ? "mono" : "", text: c })))));
|
|
926
|
+
const tbody = el("tbody");
|
|
927
|
+
for (const p of picks) {
|
|
928
|
+
const alignSt = p.topic_alignment_status || "unassessed";
|
|
929
|
+
const alignTone = alignSt === "aligned" ? "ok" : alignSt === "unmatched" ? "warn" : "";
|
|
930
|
+
const riskLvl = p.risk_level || "unassessed";
|
|
931
|
+
const riskTone = riskLvl === "high" ? "bad" : riskLvl === "medium" ? "warn" : riskLvl === "low" ? "ok" : "";
|
|
932
|
+
tbody.appendChild(el("tr", null, [
|
|
933
|
+
el("td", { class: "mono", text: String(p.rank || "-") }),
|
|
934
|
+
el("td", null, [el("strong", { text: String(p.name || p.code) }), el("div", { class: "kpi-sub mono", text: String(p.code || "") })]),
|
|
935
|
+
el("td", { text: String(p.industry || "-") }),
|
|
936
|
+
el("td", { class: "mono", text: String(p.final_score ?? p.screen_score ?? "-") }),
|
|
937
|
+
el("td", null, [
|
|
938
|
+
makeBadge(alignSt, alignTone),
|
|
939
|
+
el("span", { class: "kpi-sub", text: (p.matched_topics || []).join(", ") }),
|
|
940
|
+
]),
|
|
941
|
+
el("td", null, [
|
|
942
|
+
makeBadge(riskLvl, riskTone),
|
|
943
|
+
el("span", { class: "kpi-sub", text: (p.risk_flags || []).slice(0, 2).join(", ") }),
|
|
944
|
+
]),
|
|
945
|
+
]));
|
|
946
|
+
}
|
|
947
|
+
table.appendChild(tbody);
|
|
948
|
+
tblWrap.appendChild(table);
|
|
949
|
+
picksCard.appendChild(tblWrap);
|
|
950
|
+
root.appendChild(picksCard);
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
function renderMcp() {
|
|
954
|
+
const root = clear(document.getElementById("panel-mcp"));
|
|
955
|
+
const mcpJson = JSON.stringify({
|
|
956
|
+
mcpServers: {
|
|
957
|
+
alphasift: {
|
|
958
|
+
command: "alphasift",
|
|
959
|
+
args: ["mcp"],
|
|
960
|
+
},
|
|
961
|
+
},
|
|
962
|
+
}, null, 2);
|
|
963
|
+
const btnCopyJson = el("button", { type: "button", class: "mini-btn", text: t("copy_json") });
|
|
964
|
+
btnCopyJson.addEventListener("click", function () { copyText(mcpJson, btnCopyJson, t("copy_json")); });
|
|
965
|
+
const mcpCard = el("div", { class: "card", style: "margin-bottom:14px;" }, [
|
|
966
|
+
el("div", { class: "card-head-row" }, [
|
|
967
|
+
el("h3", { class: "section-title", text: t("mcp_title") }),
|
|
968
|
+
btnCopyJson,
|
|
969
|
+
]),
|
|
970
|
+
el("pre", { text: mcpJson }),
|
|
971
|
+
]);
|
|
972
|
+
root.appendChild(mcpCard);
|
|
973
|
+
|
|
974
|
+
const codexCmd = "codex mcp add alphasift -- alphasift mcp";
|
|
975
|
+
const btnCopyCodex = el("button", { type: "button", class: "mini-btn", text: t("copy_cmd") });
|
|
976
|
+
btnCopyCodex.addEventListener("click", function () { copyText(codexCmd, btnCopyCodex, t("copy_cmd")); });
|
|
977
|
+
const codexCard = el("div", { class: "card", style: "margin-bottom:14px;" }, [
|
|
978
|
+
el("div", { class: "card-head-row" }, [
|
|
979
|
+
el("h3", { class: "section-title", text: t("codex_title") }),
|
|
980
|
+
btnCopyCodex,
|
|
981
|
+
]),
|
|
982
|
+
el("pre", { text: codexCmd }),
|
|
983
|
+
]);
|
|
984
|
+
root.appendChild(codexCard);
|
|
985
|
+
|
|
986
|
+
const epCard = el("div", { class: "card" }, [el("h3", { class: "section-title", text: t("api_title") })]);
|
|
987
|
+
const eps = (state.index && state.index.endpoints) || [
|
|
988
|
+
"/health", "/overview", "/strategies", "/patterns", "/runs",
|
|
989
|
+
"/doctor/radar", "/doctor/data-sources", "/result-schema", "/daily-report.html",
|
|
990
|
+
];
|
|
991
|
+
const box = el("div");
|
|
992
|
+
for (const ep of eps) {
|
|
993
|
+
if (typeof ep === "string" && ep.startsWith("/") && !ep.startsWith("//")) {
|
|
994
|
+
box.appendChild(el("a", { class: "ep-link", href: ep, target: "_blank", rel: "noopener noreferrer", text: ep }));
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
epCard.appendChild(box);
|
|
998
|
+
root.appendChild(epCard);
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
function renderAll() {
|
|
1002
|
+
renderHeaderAndTabs();
|
|
1003
|
+
renderOverview();
|
|
1004
|
+
renderStrategies();
|
|
1005
|
+
renderPatterns();
|
|
1006
|
+
renderRuns();
|
|
1007
|
+
renderMcp();
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
async function refreshAll() {
|
|
1011
|
+
const [idx, ov, strats, pats, runs, radar, src] = await Promise.all([
|
|
1012
|
+
fetchJson("/?format=json").catch(() => null),
|
|
1013
|
+
fetchJson("/overview").catch(() => null),
|
|
1014
|
+
fetchJson("/strategies").catch(() => ({ strategies: [] })),
|
|
1015
|
+
fetchJson("/patterns").catch(() => ({ patterns: [] })),
|
|
1016
|
+
fetchJson("/runs").catch(() => ({ runs: [] })),
|
|
1017
|
+
fetchJson("/doctor/radar").catch(() => null),
|
|
1018
|
+
fetchJson("/doctor/data-sources?live=0").catch(() => null),
|
|
1019
|
+
]);
|
|
1020
|
+
state.index = idx;
|
|
1021
|
+
state.overview = ov;
|
|
1022
|
+
state.strategies = (strats && (strats.strategies || strats.items)) || [];
|
|
1023
|
+
state.patterns = (pats && (pats.patterns || pats.items)) || [];
|
|
1024
|
+
state.runs = (runs && (runs.runs || runs.items)) || [];
|
|
1025
|
+
state.radar = radar;
|
|
1026
|
+
state.sources = src;
|
|
1027
|
+
state.activeRun = null;
|
|
1028
|
+
renderAll();
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
document.getElementById("btn-refresh").addEventListener("click", refreshAll);
|
|
1032
|
+
document.getElementById("btn-lang").addEventListener("click", function () {
|
|
1033
|
+
state.lang = state.lang === "en" ? "zh" : "en";
|
|
1034
|
+
try { window.localStorage.setItem("alphasift_wb_lang", state.lang); } catch (_) {}
|
|
1035
|
+
syncUrl();
|
|
1036
|
+
renderAll();
|
|
1037
|
+
});
|
|
1038
|
+
document.getElementById("btn-theme").addEventListener("click", function () {
|
|
1039
|
+
state.theme = state.theme === "dark" ? "light" : "dark";
|
|
1040
|
+
applyTheme();
|
|
1041
|
+
syncUrl();
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
applyTheme();
|
|
1045
|
+
renderAll();
|
|
1046
|
+
refreshAll();
|
|
1047
|
+
})();
|
|
1048
|
+
</script>
|
|
1049
|
+
</body>
|
|
1050
|
+
</html>
|
|
1051
|
+
"""
|