From bdfa21def8ed3bc693acecd5430e081da649148a Mon Sep 17 00:00:00 2001 From: dekun Date: Fri, 26 Jun 2026 01:51:22 +0800 Subject: [PATCH] Rename positions nav to order monitor and set as default landing page. Remove stats recalculate button; login and home now open /positions without affecting refresh on other routes. Co-authored-by: Cursor --- app.py | 11 ++--------- static/js/stats.js | 18 ------------------ templates/base.html | 2 +- templates/settings.html | 4 ++-- templates/stats.html | 5 +---- templates/trade.html | 4 ++-- 6 files changed, 8 insertions(+), 36 deletions(-) diff --git a/app.py b/app.py index d77e4d8..506a970 100644 --- a/app.py +++ b/app.py @@ -709,7 +709,7 @@ def login_required(f): @app.route("/") def index(): if session.get("logged_in"): - return redirect(url_for("plans")) + return redirect(url_for("positions")) return redirect(url_for("login")) @@ -738,7 +738,7 @@ def login(): if u == admin_u and check_password_hash(admin_hash, p): session["logged_in"] = True session["username"] = u - return redirect(url_for("plans")) + return redirect(url_for("positions")) flash("账号或密码错误") return render_template("login.html") @@ -916,13 +916,6 @@ def api_position_live(): return jsonify(out) -@login_required -def index(): - if nav_enabled(get_setting, "plans"): - return redirect(url_for("plans")) - return redirect(url_for("positions")) - - @app.route("/plans") @login_required @require_nav("plans") diff --git a/static/js/stats.js b/static/js/stats.js index 9045cfe..5f71cda 100644 --- a/static/js/stats.js +++ b/static/js/stats.js @@ -145,29 +145,11 @@ document.addEventListener('DOMContentLoaded', function () { var viewSel = document.getElementById('stats-view-select'); - var refreshBtn = document.getElementById('stats-refresh-btn'); if (viewSel) { viewSel.addEventListener('change', function () { renderBreakdown(this.value); }); } - if (refreshBtn) { - refreshBtn.addEventListener('click', function () { - var btn = this; - btn.disabled = true; - btn.textContent = '计算中…'; - fetch('/api/stats/refresh', { method: 'POST' }) - .then(function (r) { return r.json(); }) - .then(applyData) - .catch(function () { - alert('重新计算失败'); - }) - .finally(function () { - btn.disabled = false; - btn.textContent = '重新计算'; - }); - }); - } loadStats(); }); })(); diff --git a/templates/base.html b/templates/base.html index d76944a..7ebcb5f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -518,7 +518,7 @@

国内期货 · 交易监控 + 复盘FUTURES MONITOR SYSTEM