From 740c99e910aa66a48558545a117b20002a1ad4b4 Mon Sep 17 00:00:00 2001 From: dekun Date: Sun, 4 Oct 2026 09:44:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E4=BE=8B=E9=A1=B6=E6=A0=8F=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=E6=8C=89=E9=92=AE?= =?UTF-8?q?=EF=BC=8C=E4=BE=BF=E4=BA=8E=E6=B8=85=E4=BC=9A=E8=AF=9D=E5=9B=9E?= =?UTF-8?q?=E5=88=B0=E7=99=BB=E5=BD=95=E9=A1=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- app.py | 1 + lib/common/static/instance_theme.css | 33 +++++++++++++++++++ .../templates/instance_header_panel.html | 3 ++ 3 files changed, 37 insertions(+) diff --git a/app.py b/app.py index abccc95..670e619 100644 --- a/app.py +++ b/app.py @@ -5571,6 +5571,7 @@ def render_main_page(page="options", embed_mode=None): ).lower() in ("1", "true", "yes", "on"), risk_status=risk_status, + show_logout=not AUTH_DISABLED, max_active_positions=MAX_ACTIVE_POSITIONS, manual_min_planned_rr=MANUAL_MIN_PLANNED_RR, key_auto_min_planned_rr=KEY_AUTO_MIN_PLANNED_RR, diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index 5bca2f4..d5de9d4 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -626,6 +626,39 @@ html[data-theme="light"] .theme-toggle-btn.is-active { margin-left: auto; } +.instance-logout-btn { + display: inline-flex; + align-items: center; + justify-content: center; + padding: 5px 12px; + font-size: 0.82rem; + line-height: 1.2; + color: var(--inst-muted, #9aa3b2); + background: transparent; + border: 1px solid rgba(255, 255, 255, 0.14); + border-radius: 8px; + text-decoration: none; + white-space: nowrap; + cursor: pointer; +} + +.instance-logout-btn:hover { + color: var(--inst-text, #e8ecf4); + border-color: rgba(255, 255, 255, 0.28); + background: rgba(255, 255, 255, 0.04); +} + +html[data-theme="light"] .instance-logout-btn { + color: #5b6472; + border-color: rgba(0, 0, 0, 0.12); +} + +html[data-theme="light"] .instance-logout-btn:hover { + color: #1f2937; + border-color: rgba(0, 0, 0, 0.22); + background: rgba(0, 0, 0, 0.03); +} + .instance-header-toolbar-filter label { display: inline-flex; align-items: center; diff --git a/lib/instance/templates/instance_header_panel.html b/lib/instance/templates/instance_header_panel.html index 4f3a675..3c7e72f 100644 --- a/lib/instance/templates/instance_header_panel.html +++ b/lib/instance/templates/instance_header_panel.html @@ -32,6 +32,9 @@ {{ risk_status.status_label|default('正常') }} {% include 'instance_theme_toggle.html' %} + {% if show_logout|default(true) %} + 退出 + {% endif %}