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 %}