Add logout control and show a single locked underlying on hedge select.
Nav gains an exit link when auth is enabled; PO option picker no longer shows unused ETH/BTC toggles. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user