Unify key support/resistance monitor type and fix form parity.

Merge 关键阻力位/关键支撑位 into 关键支撑阻力, share key_monitor_form.js across hub and new-tab views, and add hub shortcut to /key_monitor.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-19 08:31:14 +08:00
parent ce172a7cee
commit 073a382d41
15 changed files with 233 additions and 470 deletions
+4 -2
View File
@@ -157,6 +157,7 @@ from key_monitor_lib import (
KEY_DIRECTION_WATCH,
KEY_MONITOR_ALERT_ONLY_TYPES,
KEY_MONITOR_AUTO_TYPES,
KEY_MONITOR_RS_TYPE,
KEY_MONITOR_RS_TYPES,
auto_amp_ok,
auto_confirm_ok,
@@ -7684,6 +7685,7 @@ def add_key():
direction_sel = (d.get("direction") or "").strip().lower()
if mt in KEY_MONITOR_RS_TYPES:
direction_sel = KEY_DIRECTION_WATCH
mt = KEY_MONITOR_RS_TYPE
elif direction_sel not in ("long", "short"):
flash("箱体/收敛突破请选择做多或做空")
return redirect("/key_monitor")
@@ -7723,7 +7725,7 @@ def add_key():
conn = None
flash(
f"当前持仓已达上限({occupied}/{MAX_ACTIVE_POSITIONS}):无法添加「箱体突破 / 收敛突破」。"
"请平仓后再试,或使用「关键阻力位/关键支撑位」(仅单次提醒)。"
"请平仓后再试,或使用「关键支撑阻力」(仅提醒)。"
)
return redirect("/key_monitor")
ex_sym_key = normalize_exchange_symbol(symbol)
@@ -7925,7 +7927,7 @@ def add_key():
extra += f"{time_close_label(tc_h)}"
if mt in KEY_MONITOR_RS_TYPES:
flash(
f"添加成功({symbol} 日成交量排名 {rank}/{total})|阻力/支撑:双向监控上/下沿,"
f"添加成功({symbol} 日成交量排名 {rank}/{total})|关键支撑阻力:双向监控上/下沿,"
f"5m 收盘突破后微信提醒 {KEY_ALERT_MAX_TIMES} 次(间隔 {KEY_ALERT_INTERVAL_MINUTES} 分钟)"
)
else: