diff --git a/app.py b/app.py index 8b59056..315c780 100644 --- a/app.py +++ b/app.py @@ -6882,6 +6882,7 @@ def render_main_page(page="trade", embed_mode=None): _hedge_po_mode_payload = _po_mode_public() template_ctx = dict( + auth_disabled=AUTH_DISABLED, page=page, key=key_list, key_history=key_history, diff --git a/lib/common/static/hedge_plan.js b/lib/common/static/hedge_plan.js index 8761950..164ec0e 100644 --- a/lib/common/static/hedge_plan.js +++ b/lib/common/static/hedge_plan.js @@ -74,19 +74,22 @@ function lockPoUnderlyingUI() { const opt = state.optionUnderly || "ETH"; + const perp = state.perpUnderly || opt; + const modeLabel = root.getAttribute("data-po-mode-label") || poMode; + // 实例模式锁定:手动选约只显示一种标的(不展示 ETH/BTC 双钮) + const single = $("hp-uly-single"); + if (single) { + single.textContent = crossAsset ? opt + "→" + perp : opt; + single.title = "由 HEDGE_PO_MODE 锁定(" + modeLabel + "),不可页内切换"; + } document.querySelectorAll(".hp-uly-btn").forEach(function (b) { - const uly = (b.getAttribute("data-uly") || "").toUpperCase(); - const on = uly === opt; - b.classList.toggle("active", on); + b.hidden = true; b.disabled = true; - b.title = "由 HEDGE_PO_MODE 锁定(" + (root.getAttribute("data-po-mode-label") || poMode) + ")"; }); const badge = $("hp-po-mode-badge"); if (badge) { - const perp = state.perpUnderly || opt; badge.textContent = - (root.getAttribute("data-po-mode-label") || poMode) + - (crossAsset ? " · 期权" + opt + "/永续" + perp : ""); + modeLabel + (crossAsset ? " · 期权" + opt + "/永续" + perp : ""); } const ratioEl = $("hp-opt-perp-ratio"); if (ratioEl && lockedRatio > 0) { diff --git a/lib/common/static/instance_page.css b/lib/common/static/instance_page.css index a33840e..42c12e9 100644 --- a/lib/common/static/instance_page.css +++ b/lib/common/static/instance_page.css @@ -18,9 +18,11 @@ .exchange-tag{font-size:.82rem;font-weight:600;color:#b8f5d0;background:#14241e;border:1px solid #2d6a4f;padding:5px 14px;border-radius:999px;letter-spacing:.06em} .header-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center} .top-nav{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:10px 12px;margin-bottom:12px} + .top-nav-logout{grid-column:1;justify-self:start;align-self:center;padding:6px 10px;border:1px solid #304164;border-radius:8px;background:#151a2a;color:#c9d2ef;text-decoration:none;white-space:nowrap;font-size:.9rem} + .top-nav-logout:hover{border-color:#5a6f9a;color:#fff} .top-nav-links{grid-column:2;display:flex;gap:8px;flex-wrap:wrap;justify-content:center;align-items:center;min-width:0} .top-nav-links > a{flex:0 0 auto;white-space:nowrap} - .top-nav > a{justify-self:center;align-self:center;width:max-content;max-width:100%} + .top-nav > a:not(.top-nav-logout){justify-self:center;align-self:center;width:max-content;max-width:100%} .top-nav-spot-tickers{grid-column:3;justify-self:end;display:flex;flex-direction:column;gap:3px;min-width:0} .top-nav a{padding:6px 10px;border:1px solid #304164;border-radius:8px;background:#151a2a;color:#8fc8ff;text-decoration:none} .top-nav a.active{background:#2a3f6c;color:#dbe4ff} diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index 5eaa65a..39483df 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -3637,10 +3637,41 @@ html[data-theme="light"] .opt-be-dist-down { gap: 6px; align-items: center; } +.hedge-plan-page-wrap .hp-uly-single { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 3.2rem; + padding: 6px 12px; + border: 1px solid #3a4a6e; + border-radius: 8px; + background: #1a2238; + color: #dbe4ff; + font-weight: 600; + font-size: 0.88rem; + letter-spacing: 0.03em; + cursor: default; + user-select: none; +} .hedge-plan-page-wrap .hp-uly-lock .hp-uly-btn:disabled { opacity: 0.75; cursor: not-allowed; } +.top-nav-logout { + grid-column: 1; + justify-self: start; + align-self: center; +} +html[data-theme="light"] .top-nav-logout { + color: #334; + background: #f3f5fa; + border-color: #c5cddf; +} +html[data-theme="light"] .hedge-plan-page-wrap .hp-uly-single { + background: #eef1f8; + border-color: #c5cddf; + color: #1a2438; +} .hedge-plan-page-wrap .hp-po-gate-inline { font-size: 0.82rem; line-height: 1.35; diff --git a/lib/hedge_plan/templates/hedge_plan_panel.html b/lib/hedge_plan/templates/hedge_plan_panel.html index a779f16..6e32399 100644 --- a/lib/hedge_plan/templates/hedge_plan_panel.html +++ b/lib/hedge_plan/templates/hedge_plan_panel.html @@ -67,8 +67,7 @@
- - + {{ hedge_option_underlying or options_default_underly or 'ETH' }} @@ -508,4 +507,4 @@
- + diff --git a/lib/instance/templates/embed_shell.html b/lib/instance/templates/embed_shell.html index 9708f3a..89993d6 100644 --- a/lib/instance/templates/embed_shell.html +++ b/lib/instance/templates/embed_shell.html @@ -7,8 +7,8 @@ - - + + @@ -29,6 +29,9 @@
{% include 'instance_brand_header.html' %}