From a845da8d08de52cae8628eb1062435ecd93a2f7b Mon Sep 17 00:00:00 2001 From: dekun Date: Wed, 14 Oct 2026 11:28:05 +0800 Subject: [PATCH] Fix CoinOX static JS path so hedge_plan.js is served. dirname(BASE_DIR) pointed at /opt/lib and returned 404, leaving the hedge page stuck on loading. Co-authored-by: Cursor --- app.py | 3 ++- lib/hedge_plan/templates/hedge_plan_panel.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 52f2cb8..ba57417 100644 --- a/app.py +++ b/app.py @@ -9408,7 +9408,8 @@ def api_reviews(): return jsonify([row_to_dict(r) for r in rows]) -_REPO_STATIC_DIR = common_static_dir(os.path.dirname(BASE_DIR)) +# CoinOX 独立仓: app.py 与 lib/ 同级,勿再 dirname(BASE_DIR)(会落到 /opt/lib 导致静态 404) +_REPO_STATIC_DIR = common_static_dir(_REPO_ROOT) _AI_REVIEW_RENDER_JS = os.path.join(_REPO_STATIC_DIR, "ai_review_render.js") _FORM_SUBMIT_GUARD_JS = os.path.join(_REPO_STATIC_DIR, "form_submit_guard.js") _MANUAL_ORDER_RR_PREVIEW_JS = os.path.join(_REPO_STATIC_DIR, "manual_order_rr_preview.js") diff --git a/lib/hedge_plan/templates/hedge_plan_panel.html b/lib/hedge_plan/templates/hedge_plan_panel.html index 5c809ef..ed9d37d 100644 --- a/lib/hedge_plan/templates/hedge_plan_panel.html +++ b/lib/hedge_plan/templates/hedge_plan_panel.html @@ -405,4 +405,4 @@ - +