Files
dekun 53863559f4 Initialize crypto_monitor_user (user edition) from monitor codebase.
Retarget git remote, install path, and deploy docs from crypto_monitor to crypto_monitor_user.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 16:18:13 +08:00

20 lines
651 B
Python

"""中控 iframe 内软导航:服务端跳过重型同步,避免切 tab 等待数秒."""
from __future__ import annotations
from flask import Request
def request_is_hub_soft_nav(req: Request | None = None) -> bool:
"""embed=1 且带 X-Instance-Soft-Nav 头:实例页内 fetch 换页,非整页刷新."""
try:
from flask import request as flask_request
r = req or flask_request
if str(r.args.get("embed") or "").strip() != "1":
return False
flag = (r.headers.get("X-Instance-Soft-Nav") or "").strip().lower()
return flag in ("1", "true", "yes")
except Exception:
return False