修复全仓复利开启时单笔预算仍显示:flex 覆盖了 hidden,改为强制隐藏。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -295,6 +295,10 @@
|
|||||||
input.dataset.envKey = field.key;
|
input.dataset.envKey = field.key;
|
||||||
input.className = "env-field-input";
|
input.className = "env-field-input";
|
||||||
row.appendChild(input);
|
row.appendChild(input);
|
||||||
|
if (field.hidden) {
|
||||||
|
row.hidden = true;
|
||||||
|
row.style.display = "none";
|
||||||
|
}
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,6 +371,7 @@
|
|||||||
if (!budgetRow) return;
|
if (!budgetRow) return;
|
||||||
const compoundOn = !compoundSel || String(compoundSel.value || "").toLowerCase() === "true";
|
const compoundOn = !compoundSel || String(compoundSel.value || "").toLowerCase() === "true";
|
||||||
budgetRow.hidden = compoundOn;
|
budgetRow.hidden = compoundOn;
|
||||||
|
budgetRow.style.display = compoundOn ? "none" : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindCompoundBudgetVisibility(body) {
|
function bindCompoundBudgetVisibility(body) {
|
||||||
|
|||||||
@@ -2494,6 +2494,11 @@ html[data-theme="light"] .journal-detail-img-thumb {
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* display:flex 会盖掉 UA [hidden];全仓复利开时隐藏单笔预算等依赖此规则 */
|
||||||
|
.env-field-row[hidden] {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.env-field-row--restart .env-field-label {
|
.env-field-row--restart .env-field-label {
|
||||||
color: #d4c4a0;
|
color: #d4c4a0;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+21
@@ -472,6 +472,7 @@ def build_env_ui_payload(
|
|||||||
_build_field(key, label, note, schema, values)
|
_build_field(key, label, note, schema, values)
|
||||||
for key, label, note in sec["fields"]
|
for key, label, note in sec["fields"]
|
||||||
]
|
]
|
||||||
|
fields = _mark_compound_budget_hidden(fields)
|
||||||
groups.append({
|
groups.append({
|
||||||
"title": sec["title"],
|
"title": sec["title"],
|
||||||
"fields": fields,
|
"fields": fields,
|
||||||
@@ -480,6 +481,26 @@ def build_env_ui_payload(
|
|||||||
return groups
|
return groups
|
||||||
|
|
||||||
|
|
||||||
|
def _mark_compound_budget_hidden(fields: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||||
|
"""全仓复利开启时标记单笔预算为 hidden(供 SSR/前端隐藏;切换开关仍可再显示)."""
|
||||||
|
compound_on = True
|
||||||
|
for f in fields:
|
||||||
|
if f.get("key") == "OKX_OPTIONS_COMPOUND_FULL_ENABLED":
|
||||||
|
compound_on = _env_truthy(str(f.get("current") or f.get("default") or "true"))
|
||||||
|
break
|
||||||
|
if not compound_on:
|
||||||
|
return fields
|
||||||
|
out: list[dict[str, Any]] = []
|
||||||
|
for f in fields:
|
||||||
|
if f.get("key") == "OKX_OPTIONS_TRADE_BUDGET_USDC":
|
||||||
|
item = dict(f)
|
||||||
|
item["hidden"] = True
|
||||||
|
out.append(item)
|
||||||
|
else:
|
||||||
|
out.append(f)
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
def filter_updates_for_ui(exchange_key: str, updates: dict[str, str]) -> dict[str, str]:
|
def filter_updates_for_ui(exchange_key: str, updates: dict[str, str]) -> dict[str, str]:
|
||||||
allowed = ui_allowed_keys(exchange_key)
|
allowed = ui_allowed_keys(exchange_key)
|
||||||
return {k: v for k, v in (updates or {}).items() if k in allowed}
|
return {k: v for k, v in (updates or {}).items() if k in allowed}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
|
<link rel="stylesheet" href="/static/instance_theme_early.css?v=4">
|
||||||
<link rel="stylesheet" href="/static/account_risk_badge.css?v=4">
|
<link rel="stylesheet" href="/static/account_risk_badge.css?v=4">
|
||||||
<link rel="stylesheet" href="/static/instance_page.css?v=13">
|
<link rel="stylesheet" href="/static/instance_page.css?v=13">
|
||||||
<link rel="stylesheet" href="/static/instance_theme.css?v=114">
|
<link rel="stylesheet" href="/static/instance_theme.css?v=115">
|
||||||
<script src="/static/account_risk_badge.js?v=4"></script>
|
<script src="/static/account_risk_badge.js?v=4"></script>
|
||||||
<script src="/static/open_submit_gate.js?v=1"></script>
|
<script src="/static/open_submit_gate.js?v=1"></script>
|
||||||
<meta name="theme-color" content="#0b0d14">
|
<meta name="theme-color" content="#0b0d14">
|
||||||
@@ -170,7 +170,7 @@ const ORDER_ENTRY_MODEL_CODE_TO_CATEGORY = {{ entry_model_code_to_category | toj
|
|||||||
<script>
|
<script>
|
||||||
window.__INSTANCE_DISPLAY__ = {{ display | tojson }};
|
window.__INSTANCE_DISPLAY__ = {{ display | tojson }};
|
||||||
</script>
|
</script>
|
||||||
<script src="/static/instance_settings_prefs.js?v=20"></script>
|
<script src="/static/instance_settings_prefs.js?v=21"></script>
|
||||||
<script src="/static/instance_live.js?v=6"></script>
|
<script src="/static/instance_live.js?v=6"></script>
|
||||||
<script src="/static/instance_embed.js?v=31"></script>
|
<script src="/static/instance_embed.js?v=31"></script>
|
||||||
<script src="/static/instance_mobile_nav.js?v=2"></script>
|
<script src="/static/instance_mobile_nav.js?v=2"></script>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="env-form-grid">
|
<div class="env-form-grid">
|
||||||
{% for field in group.fields %}
|
{% for field in group.fields %}
|
||||||
<div class="env-field-row{% if field.restart_required %} env-field-row--restart{% endif %}" data-env-key="{{ field.key }}">
|
<div class="env-field-row{% if field.restart_required %} env-field-row--restart{% endif %}" data-env-key="{{ field.key }}"{% if field.hidden %} hidden style="display:none"{% endif %}>
|
||||||
<label class="env-field-label" for="env-f-{{ field.key }}">
|
<label class="env-field-label" for="env-f-{{ field.key }}">
|
||||||
{{ field.label or field.key }}
|
{{ field.label or field.key }}
|
||||||
{% if field.restart_required %}<span class="env-restart-mark" title="需重启">*</span>{% endif %}
|
{% if field.restart_required %}<span class="env-restart-mark" title="需重启">*</span>{% endif %}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<link rel="manifest" href="/static/icons/manifest.webmanifest">
|
<link rel="manifest" href="/static/icons/manifest.webmanifest">
|
||||||
<title>{{ pwa_app_name }}</title>
|
<title>{{ pwa_app_name }}</title>
|
||||||
<link rel="stylesheet" href="/static/instance_page.css?v=13">
|
<link rel="stylesheet" href="/static/instance_page.css?v=13">
|
||||||
<link rel="stylesheet" href="/static/instance_theme.css?v=114">
|
<link rel="stylesheet" href="/static/instance_theme.css?v=115">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body
|
<body
|
||||||
@@ -2045,6 +2045,6 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
});
|
});
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</script>
|
</script>
|
||||||
<script src="/static/instance_settings_prefs.js?v=20"></script>
|
<script src="/static/instance_settings_prefs.js?v=21"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user